Created
May 5, 2020 07:12
-
-
Save darshitvvora/ece9884e75c868f395a93e45c67acb98 to your computer and use it in GitHub Desktop.
Launch all project apps on your local machine using shell script. This is useful when some apps are dependent on other in separate projects
This file contains hidden or 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
| projDir='/home/USERNAME/projects/' | |
| declare -A MYMAPS=( | |
| ["ui-1"]="grunt serve" | |
| ["ui-2"]="grunt serve" | |
| ["ui-3"]="gulp serve" | |
| ["ui-4"]="gulp serve" | |
| ["ui-5"]="gulp serve" | |
| ["accounts"]="gulp serve" | |
| ["xtension"]="npm run dev" | |
| ["emailq"]="npm run dev" | |
| ["api"]="grunt serve" | |
| ["lambda1"]="npm run start" | |
| ["billing"]="npm run startApi;npm run startUI;npm run startLambda" | |
| ["verify"]="npm run start;npm run startLambda" | |
| ); | |
| launchCmd='' | |
| for app in "$@"; do | |
| STR=${MYMAPS[$app]} | |
| IFS=';' | |
| read -ra commandArr <<< "$STR" | |
| for command in ${commandArr[*]}; do | |
| cmd='cd '$projDir$app' && '$command | |
| launchCmd+=(--tab -t "$app=>$command" -e "bash -c '$cmd';bash") | |
| # launchCmd+=(--tab -t "$app=>$command" --working-directory="$projDir$app" -e "bash -c '$command';bash") | |
| done | |
| done | |
| gnome-terminal "${launchCmd[@]}"; | |
| # mate-terminal "${launchCmd[@]}" | |
| exit 0; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment