Last active
July 5, 2017 14:40
-
-
Save jmlavoier/dd62ce835333bfb66eb17d87c0fbd26a to your computer and use it in GitHub Desktop.
bash function to get all repositories branches
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
| function get_branches { | |
| #The environment path | |
| ENV="~/Sites/env" | |
| #The repositories inside the ENV | |
| envb=$(eval "cd $ENV" && git rev-parse --abbrev-ref HEAD) | |
| uibr=$(eval "cd $ENV/ui" && git rev-parse --abbrev-ref HEAD) | |
| appb=$(eval "cd $ENV/app" && git rev-parse --abbrev-ref HEAD) | |
| #Colors | |
| C1="\033[0;32m" | |
| C2="\033[0;36m" | |
| NC="\033[0m" | |
| printf "${C1}[ENV] ${C2}$envb\n" | |
| printf "${C1}[UI] ${C2}$uibr\n" | |
| printf "${C1}[APP] ${C2}$appb\n${NC}" | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment