1
0
mirror of https://github.com/actix/examples synced 2025-01-22 22:05:57 +01:00

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
```
This commit is contained in:
Stefano Probst 2019-05-24 20:34:08 +02:00 committed by GitHub
parent 49fc6df226
commit 25f7ce87b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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"