Skip to content

Commit 05f55e1

Browse files
committed
correct confirmorabort on git repo creation
1 parent dcc98aa commit 05f55e1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

git.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,12 @@ func EnsureRepoExists(repoPath string) {
7373
ExitFail("git required, please install")
7474
}
7575

76-
if StdoutIsTTY() {
77-
ConfirmOrAbort("Could not find dstask repository at %s -- create?", repoPath)
78-
}
79-
8076
gitDotGitLocation := path.Join(repoPath, ".git")
8177
if _, err := os.Stat(gitDotGitLocation); os.IsNotExist(err) {
78+
if StdoutIsTTY() {
79+
ConfirmOrAbort("Could not find dstask repository at %s -- create?", repoPath)
80+
}
81+
8282
err = os.Mkdir(repoPath, 0700)
8383
if err != nil {
8484
ExitFail("Failed to create directory in git repository")

0 commit comments

Comments
 (0)