From 25f7ce87b4b1fe76754f20c4fa68166e0f457210 Mon Sep 17 00:00:00 2001 From: Stefano Probst Date: Fri, 24 May 2019 20:34:08 +0200 Subject: [PATCH] Fix bug in database script Fix error that occurs if script is used like in the async_db readme. Error before this change: ``` bash $ LANG=C bash db/setup_db.sh db/setup_db.sh: line 2: db.sql: No such file or directory Error: cannot open "nyc_centralpark_weather.csv ``` --- async_db/db/setup_db.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/async_db/db/setup_db.sh b/async_db/db/setup_db.sh index 41b73f89..1d5abb02 100755 --- a/async_db/db/setup_db.sh +++ b/async_db/db/setup_db.sh @@ -1,3 +1,4 @@ #!/usr/bin/env bash -sqlite3 weather.db < db.sql -sqlite3 -csv weather.db ".import nyc_centralpark_weather.csv nyc_weather" +cd $(dirname "$0") +sqlite3 ../weather.db < db.sql +sqlite3 -csv ../weather.db ".import nyc_centralpark_weather.csv nyc_weather"