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.
git remote rename origin upstream
git checkout -b master
-echo >> .gitignore
-echo "# Ignore the configuration for the bootstrap script" >> .gitignore
-echo "bootstrap.conf" >> .gitignore
-# Add some patches, use sed until composer can do that from the command line
-# (e.g. composer config ...)
-sed -i -e 's@"extra": {@"extra": {\
- "patches-file": "composer.patches.json",@' composer.json
+# Add some patches
+composer config extra.patches-file "composer.patches.json"
cat > composer.patches.json <<EOF
{
#MYSQL_ROOT_PASSWORD="password"
EOF
+cat > .gitignore <<EOF
+# Ignore the configuration for the bootstrap script
+bootstrap.conf
+EOF
+
echo
echo "Uncomment and customize the values in the bootstrap.conf file."
# Add some basic access control to protect sensitive files like bootstrap.conf
cat > .htaccess <<EOF
Options -Indexes
-SetEnvIf Request_URI "/web/.*" access_granted
+SetEnvIf Request_URI "/web(/.*)?$" access_granted
Order allow,deny
Allow from env=access_granted
EOF