From: Antonio Ospite Date: Mon, 18 Dec 2017 15:44:37 +0000 (+0100) Subject: Check that the "bootstrap" and "clean" subcommands are run in the project dir X-Git-Tag: v0.1.0^0 X-Git-Url: https://git.ao2.it/drupal-init-tools.git/commitdiff_plain/c998fc0d092e0c5755931f2ddd779e97c72f131a Check that the "bootstrap" and "clean" subcommands are run in the project dir --- diff --git a/libexec/bootstrap.sh b/libexec/bootstrap.sh index 6d26c2e..422fafe 100755 --- a/libexec/bootstrap.sh +++ b/libexec/bootstrap.sh @@ -52,6 +52,8 @@ do shift done +[ -f "bootstrap.conf" ] || { echo "Aborting, run this command from the Drupal project directory." 1>&2; exit 1; } + # shellcheck disable=SC1091 . bootstrap.conf diff --git a/libexec/clean.sh b/libexec/clean.sh index cd33b60..b1b4c16 100755 --- a/libexec/clean.sh +++ b/libexec/clean.sh @@ -43,6 +43,8 @@ do shift done +[ -f "bootstrap.conf" ] || { echo "Aborting, run this command from the Drupal project directory." 1>&2; exit 1; } + CONFIRMATION_STRING="YESIAMSURE" echo "WARNING! This removes any files in the config/ web/ and vendor/ directories."