From c998fc0d092e0c5755931f2ddd779e97c72f131a Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Mon, 18 Dec 2017 16:44:37 +0100 Subject: [PATCH] Check that the "bootstrap" and "clean" subcommands are run in the project dir --- libexec/bootstrap.sh | 2 ++ libexec/clean.sh | 2 ++ 2 files changed, 4 insertions(+) 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." -- 2.1.4