Skip to content

Commit 41a1f51

Browse files
committed
update
1 parent 1b0d707 commit 41a1f51

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

nushell/init.nu

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,12 @@ def ghrepoclone [
187187
let directory = ([$nu.home-dir "Documents/dev" $target] | path join)
188188

189189
if ($directory | path exists) {
190-
print $"Directory ($directory) already exists"
190+
if ([$directory ".git"] | path join | path exists) {
191+
print $"Directory ($directory) already exists and is a git repository"
192+
} else {
193+
print $"Directory ($directory) already exists but is not a git repository"
194+
gh repo clone $"($org)/($repo)" $directory
195+
}
191196
} else {
192197
gh repo clone $"($parsed.org)/($parsed.repo)" $directory
193198
}

0 commit comments

Comments
 (0)