Skip to content

Instantly share code, notes, and snippets.

@esolitos
Created February 22, 2017 11:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save esolitos/6196ffb7547af39c306035c0bdab833b to your computer and use it in GitHub Desktop.
Save esolitos/6196ffb7547af39c306035c0bdab833b to your computer and use it in GitHub Desktop.
Useful bash alias/function to update Drupal modules on Composer-Based Drupal 8 installations
# Update Drupal modules on composer-based setups
comp-drup() {
if [ -z "$1" ]; then echo -e "\e[31m[ERR] You MUST specify a module name\e[0m" 1>&2; return -1; fi;
if [ ! -f ./composer.json ]; then echo -e "\e[31m[ERR] Missing composer.json file. Are you sure you're in the correct directory? \e[0m" 1>&2; return -2; fi;
composer update "drupal/$1" --with-dependencies
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment