79148518

Date: 2024-11-01 15:22:00
Score: 0.5
Natty:
Report link

A lightweight alternative to Simon Boison's example:

branch="$(git rev-parse --abbrev-ref HEAD)"

if [ $branch = development ]; then
    echo "development-script"

elif [ $branch = staging ]; then
    echo "staging-script"

elif [ $branch = production ]; then
    echo "production-script"

fi
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: trebor