Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # declare -a projects=$(ls -d */)
- # declare -a projects=$(find . -maxdepth 1 -type d)
- # declare -a projects=$(ls -d */ | cut -f1 -d'/')
- function p {
- printf "\n\t${wht}$1$2$3"
- }
- function doing {
- printf "\n\t${blu}$1$2$3"
- }
- function finished {
- printf "\n\t${gre}$1$2$3${wht}\n"
- }
- function warn {
- printf "\n\t${yel}$1$2$3"
- }
- function error {
- printf "\n\n\t${red}$1$2$3${wht}"
- }
- function insideFolderCheckStatus {
- # p "The projects are: $projects"
- if [[ -z $(git status -s) ]]; then
- finished "Already nothing to commit"
- else
- warn "Oops! Are uncommited things\n"
- git diff-index HEAD
- ALL_PROJECTS_COMMITED=false
- fi
- }
- function checkIfThingsNotCommited {
- ALL_PROJECTS_COMMITED=true
- doing "Checking for uncommited things"
- if [ -z $1 ]; then
- # for project in "${projects[@]}"
- for project in */
- do
- p "Checking status for: ${project}"
- cd ".${WORKDIR}/${project}"
- insideFolderCheckStatus
- cd ..
- done
- else
- p "Checking status for: "
- cd "$WORKDIR/quoti$1"
- insideFolderCheckStatus
- fi
- }
- checkIfThingsNotCommited
Advertisement
Add Comment
Please, Sign In to add comment