Last active
November 9, 2021 19:30
-
-
Save elfacht/58aeb2540f0cfed0728ca8bc28d81760 to your computer and use it in GitHub Desktop.
Update all local Craft CMS installations with one bash script. #craftcms
This file contains 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 | |
# | |
# 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