Last active
October 7, 2020 08:34
-
-
Save sarangnx/1aa3d5637347d8da42e94f57fbf6196b to your computer and use it in GitHub Desktop.
Revisions
-
sarangnx revised this gist
Oct 7, 2020 . 1 changed file with 31 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -2,4 +2,34 @@ git_branch() { git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/[ \1 ] /' } PS1="\[\033[02;37m\]\$(git_branch)\[\033[00m\]\[\033[01;32m\]\u\[\033[00m\]:\[\033[01;34m\]\W \[\033[00m\]\$ " # Git commit using emoji cm() { # Menu echo "[ 0 ] π feat" echo "[ 1 ] π¨ fix" echo "[ 2 ] π docs" echo "[ 3 ] π style" echo "[ 4 ] β¨ refactor" echo "[ 5 ] π test" echo "[ 6 ] π» chore" echo "[ 7 ] π¦ deps" # take user input # -n 1 takes 1 character input # -s does not echo user input read -n 1 -s option # array of prefixes prefixes=( "π feat" "π¨ fix" "π docs" "π style" "β¨ refactor" "π test" "π» chore" "π¦ deps" ) if ! [[ $option =~ ^[0-7]$ ]]; then echo "Invalid Selection π" return fi git commit -m "${prefixes[$option]}: $@" } -
sarangnx created this gist
Aug 1, 2019 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ git_branch() { git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/[ \1 ] /' } PS1="\[\033[02;37m\]\$(git_branch)\[\033[00m\]\[\033[01;32m\]\u\[\033[00m\]:\[\033[01;34m\]\W \[\033[00m\]\$ "