Skip to content

Commit

Permalink
Update main.go
Browse files Browse the repository at this point in the history
  • Loading branch information
davidrenne authored Dec 29, 2022
1 parent 589c9ef commit ba91a35
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions goCoreCreateApp/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func main() {
//also should ensure first char of appName is lower
for {
reader := bufio.NewReader(os.Stdin)
fmt.Print("GoCore AppName: ")
fmt.Print("GoCore AppName (lowercase first byte camel case proect name): ")
appName, _ = reader.ReadString('\n')
appName = strings.Trim(appName, "\n")
ok := false
Expand Down Expand Up @@ -88,7 +88,7 @@ func main() {

for {
reader := bufio.NewReader(os.Stdin)
fmt.Print("Path of module install (no trailing /): ")
fmt.Print("Path of module install (please no trailing /) It will create three subdirectories to access your app {your-path-you-enter-here}/github.com/" + username + "/" + appName + "/" + appName + "/: ")
basePath, _ = reader.ReadString('\n')
basePath = strings.Trim(basePath, "\n")
ok := false
Expand Down Expand Up @@ -194,6 +194,9 @@ func main() {
err = extensions.Write(databaseType, "/tmp/databaseType")
errorOut("extensions.WriteToFile "+databaseType+" to /tmp/databaseType", err, false)

err = extensions.Write(username, "/tmp/username")
errorOut("extensions.WriteToFile "+databaseType+" to /tmp/username", err, false)

path := "github.com/" + username + "/" + appName
err = extensions.MkDir(path)
errorOut("extensions.MkDir("+path+", 0644)", err, false)
Expand Down Expand Up @@ -274,7 +277,7 @@ func main() {
errorOut("couldnt create environment variable in .bash_profile", err, false)
}

cmd = exec.Command("go", "mod", "init", appName)
cmd = exec.Command("go", "mod", "init", "github.com/"+username+"/"+appName)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
err = cmd.Run()
Expand Down Expand Up @@ -333,8 +336,8 @@ func main() {
err = cmd.Start()
errorOut("formatting all code", err, false)

err = os.Chdir(basePath + "/" + appPath)
errorOut("cd appPath", err, false)
// err = os.Chdir(basePath + "/" + appPath)
// errorOut("cd appPath", err, false)

cmd = exec.Command("go", "install", strings.Replace(modelBuildPath, "src/", "", -1))
err = cmd.Run()
Expand Down

0 comments on commit ba91a35

Please sign in to comment.