Rocket/examples/todo/bootstrap.sh
2016-09-30 15:39:55 -07:00

15 lines
380 B
Bash
Executable File

#! /usr/bin/env bash
SCRIPT_PATH=$(cd "$(dirname "$0")" ; pwd -P)
DATABASE_URL=${SCRIPT_PATH}/db/db.sql
pushd $SCRIPT_PATH > /dev/null
# install the diesel CLI tools if they're not installed
if ! command -v diesel >/dev/null 2>&1; then
cargo install diesel_cli
fi
# create db/db.sql
diesel migration --database-url=$DATABASE_URL run
popd $SCRIPT_PATH > /dev/null