#!/bin/env bash git_current_branch() { git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/' } CUR_BRANCH=`git_current_branch` TEST=`git status | grep propre | wc -l` if [ $TEST -eq 0 ] then echo "La branche actuelle ($CUR_BRANCH) n'est pas propre" echo # (optional) move to a new line read -p "Voulez-vous voir les modifications courantes ? " -n 1 -r echo # (optional) move to a new line if [[ $REPLY =~ ^[YyOo]$ ]] then git status fi echo # (optional) move to a new line read -p "Voulez-vous ajouter les modifications courantes ? " -n 1 -r echo # (optional) move to a new line if [[ $REPLY =~ ^[YyOo]$ ]] then git add . fi fi