Skip to content

Instantly share code, notes, and snippets.

@lrobeson
Created September 17, 2013 18:27
Show Gist options
  • Save lrobeson/6598578 to your computer and use it in GitHub Desktop.
Save lrobeson/6598578 to your computer and use it in GitHub Desktop.
Bash profile for local Drupal development
#########################
# Drupal install commands
# Drupal 7 - add .htaccess, settings.php, file directories, set permissions, and return to site root
alias prepare-d7-site="cp ../drupal7/.htaccess .htaccess && cd sites/default && cp default.settings.php settings.php && chmod a+w settings.php && mkdir files && chmod a+w files && mkdir private && mkdir tmp && chmod a+w private && chmod a+w tmp && cd .. && cd .."
# Drupal 8 - add .htaccess, settings.php, file directories, set permissions, and return to site root
alias prepare-d8-site="cp ../drupal8/.htaccess .htaccess && cd sites/default && cp default.settings.php settings.php && chmod a+w settings.php && mkdir files && chmod a+w files && mkdir private && mkdir tmp && chmod a+w private && chmod a+w tmp && cd .. && cd .."
# remove unnecessary files and set permissions on settings.php ()
alias post-install-cleanup="chmod a-w sites/default/settings.php && rm CHANGELOG.txt COPYRIGHT.txt install.php INSTALL.mysql.txt INSTALL.pgsql.txt INSTALL.sqlite.txt INSTALL.txt LICENSE.txt MAINTAINERS.txt UPGRADE.txt"
# create Git repo and do initial commit
alias create-git-repo="git init && git add . && git commit -m \"initial commit\""
################
# drush commands
alias d="drush"
alias dca="drush cc all"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment