Created
February 19, 2013 18:34
-
-
Save robballou/4988578 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# create an empty shell module | |
if [[ $# -ne 1 ]]; then | |
echo 'Usage: drupal_make_module.sh [module_name]' | |
exit 1 | |
fi | |
if [[ ! -d sites/all/modules ]]; then | |
echo 'sites/all/modules does not exist' | |
exit 1 | |
fi | |
if [[ ! -d sites/all/modules/custom ]]; then | |
mkdir 'sites/all/modules/custom' | |
fi | |
MODULE_DIR=sites/all/modules/custom/$1 | |
if [[ -d $MODULE_DIR ]]; then | |
echo "$MODULE_DIR already exists" | |
exit 1 | |
fi | |
mkdir $MODULE_DIR | |
touch $MODULE_DIR/{$1.info,$1.module} | |
echo '<?php' >> $MODULE_DIR/$1.module | |
echo 'name = ' $1 >> $MODULE_DIR/$1.info | |
echo 'description = ' >> $MODULE_DIR/$1.info | |
echo 'core = 7.x' >> $MODULE_DIR/$1.info |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# initial setup for a new Drupal install | |
# - Create the files directory and make it world writable (needs to change) | |
# - Create the settings file and make it world writable | |
mkdir sites/default/files | |
chmod 777 sites/default/files | |
cp sites/default/default.settings.php sites/default/settings.php | |
chmod 777 sites/default/settings.php |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment