From: Antonio Ospite Date: Mon, 18 Dec 2017 14:54:11 +0000 (+0100) Subject: Fix double quoting, suggested by shellcheck X-Git-Tag: v0.1.0~8 X-Git-Url: https://git.ao2.it/drupal-init-tools.git/commitdiff_plain/50b546739d6ba90d12b21700dcd02cebc07f0b7f?ds=inline Fix double quoting, suggested by shellcheck --- diff --git a/drin.in b/drin.in index 4ba7583..b3abfae 100644 --- a/drin.in +++ b/drin.in @@ -18,7 +18,7 @@ set -e -PROGNAME=$(basename $0) +PROGNAME=$(basename "$0") LIBEXEC="@libexec@" usage() { @@ -35,7 +35,7 @@ EOF for subcommand in ${LIBEXEC}/*.sh; do - echo " $(basename $subcommand .sh)" + echo " $(basename "$subcommand" .sh)" done } @@ -59,7 +59,7 @@ do exit 1 else shift - exec $subcommand "$@" + exec "$subcommand" "$@" fi ;; esac diff --git a/libexec/bootstrap.sh b/libexec/bootstrap.sh index f48e303..42911cb 100755 --- a/libexec/bootstrap.sh +++ b/libexec/bootstrap.sh @@ -20,7 +20,7 @@ set -e usage() { cat <&2 echo "Use --overwrite-profile to copy over it." 1>&2 exit 1 else - cp -a $INSTALLATION_PROFILE $SITE_LOCAL_PATH/profiles + cp -a "$INSTALLATION_PROFILE" "${SITE_LOCAL_PATH}/profiles" fi fi diff --git a/libexec/clean.sh b/libexec/clean.sh index 34ef55e..daa86fb 100755 --- a/libexec/clean.sh +++ b/libexec/clean.sh @@ -20,7 +20,7 @@ set -e usage() { cat < +usage: drin $(basename "$0" .sh) [-h|--help] <machine_name> Create an installation profile from the installed project. @@ -88,8 +88,8 @@ $DRUPAL_CONSOLE generate:profile \ --profile="$PROFILE_TITLE" \ --machine-name="$PROFILE_MACHINE_NAME" \ --description="Drupal installation profile for $PROFILE_TITLE" \ - --dependencies=$ENABLED_MODULES \ - --themes=$ENABLED_THEMES \ + --dependencies="$ENABLED_MODULES" \ + --themes="$ENABLED_THEMES" \ --profile-path="$PROJECT_ROOT" \ --no-interaction @@ -107,7 +107,7 @@ find "${PROJECT_ROOT}/${PROFILE_MACHINE_NAME}/config/install" -type f -exec sed #fdupes -f -1 "${WEB_ROOT}/core/profiles/standard/config/install/" "${PROJECT_ROOT}/${PROFILE_MACHINE_NAME}/config/install/" | xargs rm # Export the default content if the default_content module is there -if echo $ENABLED_MODULES | grep -q default_content; +if echo "$ENABLED_MODULES" | grep -q default_content; then $DRUSH default-content-export-references --folder="${PROJECT_ROOT}/${PROFILE_MACHINE_NAME}/content" node fi diff --git a/libexec/new.sh b/libexec/new.sh index a73b894..2064c89 100755 --- a/libexec/new.sh +++ b/libexec/new.sh @@ -20,7 +20,7 @@ set -e usage() { cat <<EOF -usage: drin $(basename $0 .sh) [-h|--help] <destdir> +usage: drin $(basename "$0" .sh) [-h|--help] <destdir> Create a new Drupal project in the 'destdir' directory.