Skip to content

Instantly share code, notes, and snippets.

@telmotrooper
Last active May 31, 2019 22:01
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 telmotrooper/d80337feb3cc57b72950d1befd35dcfc to your computer and use it in GitHub Desktop.
Save telmotrooper/d80337feb3cc57b72950d1befd35dcfc to your computer and use it in GitHub Desktop.
POSIX-compliant deploy function
function deploy {
deploy_dir=/home/telmo/Development/deploy-scripts
if [ $1 = "frontend" ] || [ $1 = "front" ] || [ $1 = "f" ]; then
sh "$deploy_dir/deploy_frontend.sh"
elif [ $1 = "backend" ] || [ $1 = "back" ] || [ $1 = "b" ]; then
sh "$deploy_dir/deploy_backend.sh"
else
(>&2 echo "ERROR: \"$1\" doesn't match any known parameter.")
return 1
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment