Adds riesel

This commit is contained in:
Thomas Forgione 2020-01-15 11:41:11 +01:00
parent 30f652007c
commit b03a69e59e
1 changed files with 17 additions and 0 deletions

17
bin/riesel Executable file
View File

@ -0,0 +1,17 @@
#!/usr/bin/env bash
# Looks for the Rocket.toml and uses the database url in it to run diesel
# commands.
while [ ! -f Rocket.toml ]; do
cd ..
if [ "$PWD" == "/" ]; then
echo -e >&2 "\033[31;1merror:\033[0m unable to find a Rocket.toml"
exit 1
fi
done
url=$(cat Rocket.toml | grep url | cut -d '"' -f 2)
diesel --database-url $url $@