Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions shared-modules/MTREADME.md.MT.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,14 @@ else
exit 1 # error
fi

AGENCY_TYPE_FILE="${CONFIG_DIR}/agency_type";
if [ -f "$AGENCY_TYPE_FILE" ]; then
AGENCY_TYPE_SHORT=$(head -n 1 "$AGENCY_TYPE_FILE");
if [ -n "$AGENCY_TYPE_SHORT" ]; then
TYPE_LABEL="$AGENCY_TYPE_SHORT";
fi
fi
Comment thread
mmathieum marked this conversation as resolved.

cat >>"${README_FILE}" <<EOL
<!-- DO NOT EDIT: this file is generated by MTREADME.md.MT.sh -->
# $AGENCY_LABEL $TYPE_LABEL for [MonTransit](https://github.com/mtransitapps/mtransit-for-android)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,14 @@ else
exit 1 # error
fi

AGENCY_TYPE_FILE="${CONFIG_DIR}/agency_type";
if [ -f "$AGENCY_TYPE_FILE" ]; then
AGENCY_TYPE_SHORT=$(head -n 1 "$AGENCY_TYPE_FILE");
if [ -n "$AGENCY_TYPE_SHORT" ]; then
TYPE_LABEL="$AGENCY_TYPE_SHORT";
fi
fi
Comment thread
mmathieum marked this conversation as resolved.

PROVIDES_LINE="This app provides the $TYPE_LABEL";

INFORMATION_LIST="";
Expand Down Expand Up @@ -255,7 +263,7 @@ YOUTUBE_FILE="${VALUES_DIR}/youtube_values.xml";
if [[ -f "${RSS_FILE}" || -f "${TWITTER_FILE}" || -f "${YOUTUBE_FILE}" ]]; then
if [ -z "$PROVIDES_LINE_END" ]; then
PROVIDES_LINE_END="${PROVIDES_LINE_END} and";
else
else
PROVIDES_LINE_END="${PROVIDES_LINE_END},";
fi
PROVIDES_LINE_END="${PROVIDES_LINE_END} news";
Expand Down Expand Up @@ -338,7 +346,7 @@ if [ -f "${GTFS_RT_FILE}" ]; then
RT_LINE=" real-time${RT_LINE}";
if [ -z "$PROVIDES_LINE_END" ]; then
PROVIDES_LINE_END=" and${RT_LINE}${PROVIDES_LINE_END}";
else
else
PROVIDES_LINE_END=",${RT_LINE}${PROVIDES_LINE_END}";
fi
fi
Expand Down Expand Up @@ -398,7 +406,7 @@ if [ -f "${GTFS_RT_FILE}" ]; then
echo "Permissions:" >> "${FULL_DESCRIPTION_FILE}";
checkResult $?;
PERMISSIONS_LINE="- Other: required to download";
else
else
PERMISSIONS_LINE="${PERMISSIONS_LINE} and";
fi
PERMISSIONS_LINE="${PERMISSIONS_LINE} real-time service alerts";
Expand All @@ -409,7 +417,7 @@ if [[ -f "${RSS_FILE}" || -f "${TWITTER_FILE}" || -f "${YOUTUBE_FILE}" ]]; then
echo "Permissions:" >> "${FULL_DESCRIPTION_FILE}";
checkResult $?;
PERMISSIONS_LINE="- Other: required to download";
else
else
PERMISSIONS_LINE="${PERMISSIONS_LINE} and";
fi
PERMISSIONS_LINE="${PERMISSIONS_LINE} news";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,14 @@ else
exit 1 # error
fi

AGENCY_TYPE_FILE="${CONFIG_DIR}/agency_type";
if [ -f "$AGENCY_TYPE_FILE" ]; then
AGENCY_TYPE_SHORT=$(head -n 1 "$AGENCY_TYPE_FILE");
if [ -n "$AGENCY_TYPE_SHORT" ]; then
TYPE_LABEL="$AGENCY_TYPE_SHORT";
fi
fi
Comment thread
mmathieum marked this conversation as resolved.

SHORT_DESC="$AGENCY_NAME_LONG $TYPE_LABEL for MonTransit.";

if [ -n "$AGENCY_LOCATION_SHORT" ]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,14 @@ else
exit 1 # error
fi

AGENCY_TYPE_FILE="${CONFIG_DIR}/agency_type";
if [ -f "$AGENCY_TYPE_FILE" ]; then
AGENCY_TYPE_SHORT=$(head -n 1 "$AGENCY_TYPE_FILE");
if [ -n "$AGENCY_TYPE_SHORT" ]; then
TYPE_LABEL="$AGENCY_TYPE_SHORT";
fi
fi
Comment thread
mmathieum marked this conversation as resolved.

MAX_LENGTH=30;
TYPE_LABEL_MIN_LENGTH=3; # ${#TYPE_LABEL}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ CITIES_LABEL=$(echo $CITIES_LABEL | awk -v len=$MAX_CITY_LENGTH '{ if (length($0
if [[ -z "${AGENCY_NAME_2}" ]]; then
$ROOT_DIR/commons-android/pub/module-featured-graphic.sh "$AGENCY_NAME_1" "$CITIES_LABEL" "$STATE_AND_COUNTRY_LABEL";
checkResult $?;
else
else
$ROOT_DIR/commons-android/pub/module-featured-graphic.sh "$AGENCY_NAME_1" "$AGENCY_NAME_2" "$CITIES_LABEL" "$STATE_AND_COUNTRY_LABEL";
checkResult $?;
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ YOUTUBE_FILE="${VALUES_DIR}/youtube_values.xml";
if [[ -f "${RSS_FILE}" || -f "${TWITTER_FILE}" || -f "${YOUTUBE_FILE}" ]]; then
if [ -z "$PROVIDES_LINE_END" ]; then
PROVIDES_LINE_END="${PROVIDES_LINE_END} et";
else
else
PROVIDES_LINE_END="${PROVIDES_LINE_END},";
fi
PROVIDES_LINE_END="${PROVIDES_LINE_END} les nouvelles";
Expand Down Expand Up @@ -350,7 +350,7 @@ if [ -f "${GTFS_RT_FILE}" ]; then
RT_LINE="${RT_LINE} en temps-réel";
if [ -z "$PROVIDES_LINE_END" ]; then
PROVIDES_LINE_END=" et${RT_LINE}${PROVIDES_LINE_END}";
else
else
PROVIDES_LINE_END=",${RT_LINE}${PROVIDES_LINE_END}";
fi
fi
Expand Down Expand Up @@ -410,7 +410,7 @@ if [ -f "${GTFS_RT_FILE}" ]; then
echo "Autorisations :" >> "${FULL_DESCRIPTION_FILE}";
checkResult $?;
PERMISSIONS_LINE="- Autres : requis pour le téléchargement des";
else
else
PERMISSIONS_LINE="${PERMISSIONS_LINE} et des";
fi
PERMISSIONS_LINE="${PERMISSIONS_LINE} alertes de service en temps-réel";
Expand All @@ -421,7 +421,7 @@ if [[ -f "${RSS_FILE}" || -f "${TWITTER_FILE}" || -f "${YOUTUBE_FILE}" ]]; then
echo "Autorisations :" >> "${FULL_DESCRIPTION_FILE}";
checkResult $?;
PERMISSIONS_LINE="- Autres : requis pour le téléchargement des";
else
else
PERMISSIONS_LINE="${PERMISSIONS_LINE} et des";
fi
PERMISSIONS_LINE="${PERMISSIONS_LINE} nouvelles";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,14 @@ else
exit 1 # error
fi

AGENCY_TYPE_FILE="${CONFIG_DIR}/agency_type";
if [ -f "$AGENCY_TYPE_FILE" ]; then
AGENCY_TYPE_SHORT=$(head -n 1 "$AGENCY_TYPE_FILE");
if [ -n "$AGENCY_TYPE_SHORT" ]; then
TYPE_LABEL="$AGENCY_TYPE_SHORT";
fi
fi
Comment thread
mmathieum marked this conversation as resolved.

cat >>"${GTFS_RTS_STRINGS_FILE}" <<EOL
<?xml version="1.0" encoding="utf-8"?>
<!-- DO NOT EDIT: this file is generated by MTgtfs_rts_strings.xml.MT.sh -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,14 @@ else
exit 1 # error
fi

AGENCY_TYPE_FILE="${CONFIG_DIR}/agency_type";
if [ -f "$AGENCY_TYPE_FILE" ]; then
AGENCY_TYPE_SHORT=$(head -n 1 "$AGENCY_TYPE_FILE");
if [ -n "$AGENCY_TYPE_SHORT" ]; then
TYPE_LABEL="$AGENCY_TYPE_SHORT";
fi
fi
Comment thread
mmathieum marked this conversation as resolved.

AGENCY_LOCATION_SHORT="" # optional
AGENCY_LOCATION_FILE="${CONFIG_DIR}/agency_location";
if [ -f "$AGENCY_LOCATION_FILE" ]; then
Expand Down
8 changes: 8 additions & 0 deletions shared-modules/gh_repo_update_details.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,14 @@ else
exit 1 # error
fi

AGENCY_TYPE_FILE="${CONFIG_DIR}/agency_type";
if [ -f "$AGENCY_TYPE_FILE" ]; then
AGENCY_TYPE_SHORT=$(head -n 1 "$AGENCY_TYPE_FILE");
if [ -n "$AGENCY_TYPE_SHORT" ]; then
TYPE_LABEL="$AGENCY_TYPE_SHORT";
fi
fi
Comment thread
mmathieum marked this conversation as resolved.

REPO_DESC="$AGENCY_LABEL $TYPE_LABEL for MonTransit"
REPO_URL="https://play.google.com/store/apps/details?id=$PKG"

Expand Down