Checking if the path already exists or not before creating the project
This commit is contained in:
parent
6cc11d4b60
commit
bfd928ca53
|
@ -146,8 +146,12 @@ benchmark:
|
||||||
func setupBasecoinWorkspace(projectName string, remoteProjectPath string) {
|
func setupBasecoinWorkspace(projectName string, remoteProjectPath string) {
|
||||||
projectPath := resolveProjectPath(remoteProjectPath)
|
projectPath := resolveProjectPath(remoteProjectPath)
|
||||||
fmt.Println("Configuring your project in " + projectPath)
|
fmt.Println("Configuring your project in " + projectPath)
|
||||||
|
if _, err := os.Stat(projectPath); os.IsNotExist(err) {
|
||||||
copyBasecoinTemplate(projectName, projectPath, remoteProjectPath)
|
copyBasecoinTemplate(projectName, projectPath, remoteProjectPath)
|
||||||
createGopkg(projectPath)
|
createGopkg(projectPath)
|
||||||
createMakefile(projectPath)
|
createMakefile(projectPath)
|
||||||
fmt.Printf("\nInitialized a new project at %s.\nHappy hacking!\n", projectPath)
|
fmt.Printf("\nInitialized a new project at %s.\nHappy hacking!\n", projectPath)
|
||||||
|
} else {
|
||||||
|
fmt.Printf("\n%s already exists, please choose a different project path\n", projectPath)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue