summaryrefslogtreecommitdiff
path: root/cmd/ponzu/options.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/ponzu/options.go')
-rw-r--r--cmd/ponzu/options.go14
1 files changed, 12 insertions, 2 deletions
diff --git a/cmd/ponzu/options.go b/cmd/ponzu/options.go
index b23ab2d..062975b 100644
--- a/cmd/ponzu/options.go
+++ b/cmd/ponzu/options.go
@@ -169,13 +169,17 @@ func newProjectInDir(path string) error {
var answer string
_, err := fmt.Scanf("%s\n", &answer)
if err != nil {
- return err
+ if err.Error() == "unexpected newline" {
+ answer = ""
+ } else {
+ return err
+ }
}
answer = strings.ToLower(answer)
switch answer {
- case "n", "no", "":
+ case "n", "no", "\r\n", "\n", "":
fmt.Println("")
case "y", "yes":
@@ -288,6 +292,12 @@ func createProjInDir(path string) error {
return err
}
+ gitDir := filepath.Join(path, ".git")
+ err = os.RemoveAll(gitDir)
+ if err != nil {
+ fmt.Println("Failed to remove .git directory from your project path. Consider removing it manually.")
+ }
+
fmt.Println("New ponzu project created at", path)
return nil
}