From 28dd097db826f8d22d577d913e06adba68d0598a Mon Sep 17 00:00:00 2001 From: Aaron Paz Date: Wed, 26 Dec 2018 23:47:39 -0800 Subject: [PATCH] backwards conditional logic -_- --- cobra/cmd/init.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cobra/cmd/init.go b/cobra/cmd/init.go index 19fca164..af155c2e 100644 --- a/cobra/cmd/init.go +++ b/cobra/cmd/init.go @@ -88,18 +88,18 @@ func initializeProject(project *Project) { } else if !isEmpty(project.AbsPath()) && !force { // If path exists and is not empty don't use it er("Cobra will not create a new project in a non empty directory: " + project.AbsPath()) } else if !isEmpty(project.AbsPath()) && force { // If path exists and force flag is true, use it but check to see if files exist first - if !exists(project.AbsPath() + "/" + project.License().Name) { - fmt.Println(project.AbsPath() + "/LICENSE.txt exists... Skipping") + if !exists(project.AbsPath() + "/" + "LICENSE.txt") { + fmt.Println(project.AbsPath() + "/LICENSE.txt does not exist... Creating") createLicenseFile(project.License(), project.AbsPath()) } if !exists(project.AbsPath() + "/" + "main.go") { - fmt.Println(project.AbsPath() + "/main.go exists... Skipping") + fmt.Println(project.AbsPath() + "/main.go does not exist... Creating") createMainFile(project) } if !exists(project.AbsPath() + "/" + "cmd/root.go") { - fmt.Println(project.AbsPath() + "/cmd/root.go exists... Skipping") + fmt.Println(project.AbsPath() + "/cmd/root.go does not exist... Creating") createRootCmdFile(project) } } else {