set -e
-PROGNAME=$(basename $0)
+PROGNAME=$(basename "$0")
LIBEXEC="@libexec@"
usage() {
for subcommand in ${LIBEXEC}/*.sh;
do
- echo " $(basename $subcommand .sh)"
+ echo " $(basename "$subcommand" .sh)"
done
}
exit 1
else
shift
- exec $subcommand "$@"
+ exec "$subcommand" "$@"
fi
;;
esac
usage() {
cat <<EOF
-usage: drin $(basename $0 .sh) [--devel|-h|--help]
+usage: drin $(basename "$0" .sh) [--devel|-h|--help]
Bootstrap a Drupal project, using settings from a 'bootstrap.conf' file.
# This becomes unnecessary if the installation profile gets pulled in by
# composer.json, like suggested in
# https://github.com/drupal-composer/drupal-project/issues/249
-if ! echo $INSTALLATION_PROFILE | egrep -q "^(minimal|standard)$";
+if ! echo "$INSTALLATION_PROFILE" | egrep -q "^(minimal|standard)$";
then
- if [ -d $SITE_LOCAL_PATH/profiles/$INSTALLATION_PROFILE -a "$OVERWRITE_PROFILE" != "true" ];
+ if [ -d "${SITE_LOCAL_PATH}/profiles/${INSTALLATION_PROFILE}" -a "$OVERWRITE_PROFILE" != "true" ];
then
echo "Installation profile '$INSTALLATION_PROFILE' already there." 1>&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
usage() {
cat <<EOF
-usage: drin $(basename $0 .sh) [-h|--help]
+usage: drin $(basename "$0" .sh) [-h|--help]
Cleanup the project, removing all the installed files.
read -p "Type ${CONFIRMATION_STRING} to confirm: " INPUT
run() {
- echo $*
- $*
+ echo "$@"
+ "$@"
}
[ "$INPUT" = "$CONFIRMATION_STRING" ] && run sudo rm -rf config/ web/ vendor/ composer.lock
usage() {
cat <<EOF
-usage: drin $(basename $0 .sh) [-h|--help] <title> <machine_name>
+usage: drin $(basename "$0" .sh) [-h|--help] <title> <machine_name>
Create an installation profile from the installed project.
--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
#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
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.