We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1b0d707 commit 41a1f51Copy full SHA for 41a1f51
nushell/init.nu
@@ -187,7 +187,12 @@ def ghrepoclone [
187
let directory = ([$nu.home-dir "Documents/dev" $target] | path join)
188
189
if ($directory | path exists) {
190
- print $"Directory ($directory) already exists"
+ 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
+ }
196
} else {
197
gh repo clone $"($parsed.org)/($parsed.repo)" $directory
198
}
0 commit comments