Skip to content

Commit

Permalink
Gitディレクトリが無いときにメッセージ出力
Browse files Browse the repository at this point in the history
  • Loading branch information
shimoe committed Nov 2, 2018
1 parent 1ccd807 commit 9f29e05
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Git/fetch_all.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!bin/bash

_git_pull(){
git pull origin $(echo $(git branch --contains | sed -e 's/\*//'))
git pull origin $(echo $(git symbolic-ref --short HEAD))
}

_select_mode(){
Expand Down Expand Up @@ -31,7 +31,12 @@ _select_pull(){
_git_action(){
ROOT_DIR=$(pwd)
echo -e "\e[34mroot_dir : $ROOT_DIR\e[m\n"
dir_list=$(echo $(dirname $(find -type d -name .git)))
git_dirs=$(find -type d -name .git)
if [ "$git_dirs" = "" ]; then
echo "No such Git directory. Exit scripts."
return 2> /dev/null
fi
dir_list=$(echo $(dirname $git_dirs))
dir_array=($dir_list)
i=0;
for target_dir in ${dir_array[@]}; do
Expand Down

0 comments on commit 9f29e05

Please sign in to comment.