Skip to content

Instantly share code, notes, and snippets.

@timwright12
Created October 26, 2020 15:55
Show Gist options
  • Save timwright12/2f05cb39313152fb4db53cda514a7cd7 to your computer and use it in GitHub Desktop.
Save timwright12/2f05cb39313152fb4db53cda514a7cd7 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
runCmd() {
echo ""
echo ">>> $@"
echo ""
eval "$@"
local code=$?
[[ $code -ne 0 ]] && return $code
}
named-command() {
local YELLOW='\033[0;33m'
local GREEN='\033[0;32m'
local NC='\033[0m' # No Color
echo -e "${YELLOW}Yellow message${NC}"
runCmd "cd items/"
}
eval $@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment