diff options
author | Asa Venton <asav1410@gmail.com> | 2019-10-21 21:47:15 +0100 |
---|---|---|
committer | Asa Venton <asav1410@gmail.com> | 2019-10-21 21:47:15 +0100 |
commit | 8c1a5fdead9725ec12fd72b96e93db033f4d2e8d (patch) | |
tree | c5984072ad11cccce0cfc4ffcf45d2cae9cdd89c | |
parent | 160a1ff9ede5520b1d33d4f60ae5215981801d41 (diff) |
Fix comments, remove complete TODO, swap unneeded elif for else
-rwxr-xr-x | livetimes.sh | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/livetimes.sh b/livetimes.sh index 5f633f1..39ebc07 100755 --- a/livetimes.sh +++ b/livetimes.sh @@ -1,6 +1,5 @@ #!/bin/bash # TODO: If $stop similar to "Bus Station" then reject and suggest user tries supplying a route number to see when their next bus leaves the station -# TODO: Fix duplication of destinations and routes in result read stop # function to provide data to a for loop @@ -13,7 +12,6 @@ _liveresult() { exitcode=$? # sort livetimes by service_number and eta livetimes=$(echo ${livetimes} | jq 'sort_by((.service_number | sub("[^0-9]$"; "") | tonumber), (.service_number | sub("[^A-Z]$"; "") | tostring), .eta)') - #livetimes=$(echo ${livetimes} | jq 'sort_by((.service_number | [ (sub("[^0-9]*$"; "") | tonumber), sub("^[0-9]*"; "") ]), .eta))' livetimeslen=$(echo ${livetimes} | jq '. | length') if [ $exitcode != 0 ]; then echo "cURL error - exiting." @@ -26,7 +24,7 @@ _liveresult() { if [[ $(_jq '.service_number') != $outroute ]]; then result=$(echo $result | sed 's/,$//') result="$result | Dest: $(_jq '.destination')[$(_jq '.service_number')] - ETAs: $(_jq '.eta'), " - elif [ $outroute = $outroute ]; then + else result="$result $(_jq '.eta'), " fi outroute=$(_jq '.service_number') |