gtfs-via-postgres
gtfs-via-postgres copied to clipboard
Add folder mode
Thanks for the script everyone.
Changes
I added a 'folder mode' argument that takes the argument and reads the given directory, then parses the files in it as normal, regardless of file extention.
Why
I had it working on my work macbook (m3), however I was fooling around with it relentlessly on my personal PC (Windows + WSL2). I could not get it working for the life of me with the provided examples or while fooling around with the command.
Does it work?
I tested it on my local windows machine using WSL2 ubuntu 22 with 'moreutils' (for sponge) and 'postgres' installed. Using node v22 I ran the script beneath which resulted in the proper output as I got on my macbook without folder mode.
node cli.js --folder-mode --stops-location-index --require-dependencies -u -- gtfs | sponge | psql -h localhost -p 5432 -b -U postgres
(folder in example script is ./gtfs including all gtfs.txt files)