From b03a69e59efc6d818fa41d918c49716fa7aafb04 Mon Sep 17 00:00:00 2001 From: Thomas Forgione Date: Wed, 15 Jan 2020 11:41:11 +0100 Subject: [PATCH] Adds riesel --- bin/riesel | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 bin/riesel diff --git a/bin/riesel b/bin/riesel new file mode 100755 index 0000000..3e3c150 --- /dev/null +++ b/bin/riesel @@ -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 $@