fixed alias

This commit is contained in:
KeeganForelight 2023-01-13 21:25:34 -05:00
parent d99abaed6a
commit d60276e403

6
bb
View File

@ -40,7 +40,7 @@ fi
# creating station alias list on fresh installs # creating station alias list on fresh installs
if [[ ! -e "$ALIAS_FILE" ]] ; then if [[ ! -e "$ALIAS_FILE" ]] ; then
starter_json=$(printf '{ "stations": [] }' | gojq '.') starter_json=$(printf '{}' | gojq '.')
echo "$starter_json" > "$ALIAS_FILE" echo "$starter_json" > "$ALIAS_FILE"
fi fi
@ -166,9 +166,9 @@ print_status() {
# prints # prints
get_station_info # sets $DOCKS $BIKES and $STATIONID get_station_info # sets $DOCKS $BIKES and $STATIONID
if [[ -e "$WORKINGDIR/aliases.json" ]] ; then if [[ -e "$ALIAS_FILE" ]] ; then
FMT_STATIONID=$(printf '"%d"' $STATIONID) FMT_STATIONID=$(printf '"%d"' $STATIONID)
ALIAS=$(cat "$WORKINGDIR/aliases.json" | gojq ".$FMT_STATIONID" | tr -d '"') ALIAS=$(cat "$ALIAS_FILE" | gojq ".$FMT_STATIONID" | tr -d '"')
if [[ ! -z "$ALIAS" ]] ; then if [[ ! -z "$ALIAS" ]] ; then
STATION_NAME="$ALIAS" STATION_NAME="$ALIAS"
fi fi