File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -4,10 +4,17 @@ function git_clone_to() {
44 local basedir=$2
55 local email=$3
66 local dir=$basedir /${1##*/ }
7- if [[ ! -d $dir ]]; then
7+ if [[ -d $dir ]]; then
8+ (
9+ cd " $dirb "
10+ log_msg " git pull at $dir "
11+ git pull -q
12+ )
13+ else
814 if [[ ! -d $basedir ]]; then mkdir -p $basedir ; fi
915 log_msg " git clone $url at $dir "
1016 git clone $url $dir
17+
1118 fi
1219 if [[ -n $email ]]; then
1320 (
Original file line number Diff line number Diff line change @@ -8,7 +8,12 @@ function git_clone_to() {
88 log_error " Usage: git_clone_to <url> <basedir> [<email>]. Use <email> to differ from ~/.gitconfig email." ; return
99 }
1010 $dir = Join-Path $basedir (Split-Path $url - Leaf)
11- if (-not (Test-Path $dir )) {
11+ if (Test-Path $dir ) {
12+ Push-Location $dir
13+ log_msg " git pull at $dir "
14+ git pull - q
15+ Pop-Location
16+ } else {
1217 if (-not (Test-Path $basedir )) {
1318 New-Item - Path $basedir - ItemType Directory - Force
1419 }
You can’t perform that action at this time.
0 commit comments