diff --git a/bluebikes b/bluebikes index bf5cc18..a7f36ae 100755 --- a/bluebikes +++ b/bluebikes @@ -5,7 +5,6 @@ usage() { cat < "$ALIASES_FILE" + # adding to file + tmp=$(cat "$ALIASES_FILE" | gojq --arg name "$ALIAS" --arg id "$STATION_ID" 'setpath([$id]; $name)') + echo "$tmp" > "$ALIASES_FILE" # printing change if [[ -z "$ALIAS" ]] ; then @@ -181,7 +178,7 @@ print_status() { id=$(printf '"%d"' $STATION_ID) ALIAS=$(cat "$ALIASES_FILE" | gojq ".$id" | tr -d '"') - if [[ "$ALIAS" != "null" ]] ; then + if [[ "$ALIAS" != "null" && ! -z "$ALIAS" ]] ; then # if there is an alias STATION_NAME="$ALIAS" fi