X-Git-Url: https://git.danieliu.xyz/?p=dotfiles.git;a=blobdiff_plain;f=Scripts%2Fgit-pushall;h=311da79f8d7a0f29c18f1012d6489f563817a61c;hp=0d7def61399ee9382740e8b38a4d9512f58c9d63;hb=bea758d3a4f0fe9ff27425b3a0444759ed049693;hpb=366f6e01929c651e868d008521bf56cc8d1414c2 diff --git a/Scripts/git-pushall b/Scripts/git-pushall index 0d7def6..311da79 100755 --- a/Scripts/git-pushall +++ b/Scripts/git-pushall @@ -4,13 +4,21 @@ # e.g # git-pushall git --git-dir=$HOME/.dotfiles --work-tree=$HOME -cmd="$@" -[ -z "$cmd" ] && cmd="git" +# cmd="$@" +# [ -z "$cmd" ] && cmd="git" -config_path="$($cmd config --local -l)" 2>/dev/null +# config_path="$($cmd config --local -l)" 2>/dev/null +# [ ! "$?" = 0 ] && echo "Failed: not a git repo." && exit 1 + +# echo "$config_path" | grep '^remote.*.url=' |\ +# sed 's/^remote.*.url=//' |\ +# xargs printf "$cmd push %s master\n" |\ + +[ -z "$1" ] && echo "Please provide a branch to push to" && exit 1 + +config_path="$(git config --local -l)" 2>/dev/null [ ! "$?" = 0 ] && echo "Failed: not a git repo." && exit 1 echo "$config_path" | grep '^remote.*.url=' |\ sed 's/^remote.*.url=//' |\ - xargs printf "$cmd push %s master\n" |\ - + xargs -I _ git push _ "$1"