Skip to content

Commit 9fb4a65

Browse files
authored
Merge pull request #100 from HSLdevcom/allow-no-stops
GTFS indexing tolerates packages without stops.txt
2 parents 438ce2e + d3b0d22 commit 9fb4a65

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

scripts/dl-and-index.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,12 @@ rm -rf tpdc
5454
# param2: import folder name
5555
function import_gtfs {
5656
unzip -o $1
57-
58-
# extract feed id
59-
index=$(sed -n $'1s/,/\\\n/gp' feed_info.txt | grep -nx 'feed_id' | cut -d: -f1)
60-
prefix=$(cat feed_info.txt | sed -n 2p | cut -d "," -f $index)
61-
node $TOOLS/pelias-gtfs/import -d $DATA/$2 --prefix=$prefix
57+
if [ -f stops.txt ]; then
58+
# extract feed id
59+
index=$(sed -n $'1s/,/\\\n/gp' feed_info.txt | grep -nx 'feed_id' | cut -d: -f1)
60+
prefix=$(cat feed_info.txt | sed -n 2p | cut -d "," -f $index)
61+
node $TOOLS/pelias-gtfs/import -d $DATA/$2 --prefix=$prefix
62+
fi
6263
# remove already parsed gtfs files
6364
rm *.txt
6465
}

0 commit comments

Comments
 (0)