Make loading script work regardless of directory
authorMagnus Hagander <magnus@hagander.net>
Fri, 1 Jan 2021 15:19:14 +0000 (16:19 +0100)
committerMagnus Hagander <magnus@hagander.net>
Fri, 1 Jan 2021 15:19:14 +0000 (16:19 +0100)
pgweb/load_initial_data.sh

index dcb09b0939e6ca675ed068dad041f13e75b882e7..05c58a57dcb53933175b3b1ae78e9ff3c2043a85 100755 (executable)
@@ -8,6 +8,8 @@ echo WARNING: this may overwrite some data in the database with an initial set o
 echo 'Are you sure you want this (answer "yes" to overwrite)'
 read R
 
+cd $(dirname $0)
+
 if [ "$R" == "yes" ]; then
    find . -name data.yaml | xargs ../manage.py loaddata
 fi