Only recreate the database on the first run

This commit is contained in:
coolneng 2021-02-08 01:34:54 +01:00
parent 91e8abf224
commit ad63122878
Signed by: coolneng
GPG Key ID: 9893DA236405AF57
2 changed files with 5 additions and 1 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
databases

View File

@ -23,7 +23,10 @@ in mkShell {
pg_ctl start -o "--unix_socket_directories=${data_dir} --listen_addresses='''" pg_ctl start -o "--unix_socket_directories=${data_dir} --listen_addresses='''"
fi fi
psql -d postgres -f ${sql_file} if [ ! -d ${data_dir} ]; then
psql -d postgres -f ${sql_file}
fi
alias psql='psql -d postgres' alias psql='psql -d postgres'
alias nuke='rm -rf ${data_dir}' alias nuke='rm -rf ${data_dir}'