Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@elfacht
Last active November 9, 2021 19:30
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 elfacht/58aeb2540f0cfed0728ca8bc28d81760 to your computer and use it in GitHub Desktop.
Save elfacht/58aeb2540f0cfed0728ca8bc28d81760 to your computer and use it in GitHub Desktop.
Update all local Craft CMS installations with one bash script. #craftcms
#!/bin/bash
#
# Update all local Craft CMS installations at once
# by adding the folder names and running:
#
# $ ./craft-updater.sh
#
ROOT_PATH="/path/to/local/htdocs/"
#######################################
# Exit if any command fails
#######################################
set -e
#######################################
# Craft CMS commands and composer
#######################################
function updater() {
echo '####### '$1 '#######';
cd "$ROOT_PATH/$1/" && composer update
php craft up
}
#######################################
# Project folders
# e.g. $ROOT_PATH/my-project-1/
#######################################
updater "my-project-1"
updater "my-project-2"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment