feat(init): Add some logs and initialize git
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
7dcce0f6bf
commit
4c53c57d5e
24
cmd/init.go
24
cmd/init.go
@ -6,6 +6,7 @@ package cmd
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
|
"os/exec"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
@ -145,7 +146,7 @@ func runInitAction(cmd *cobra.Command, args []string) {
|
|||||||
log.Debugf("Our project directory path is: %s", projectDirPath)
|
log.Debugf("Our project directory path is: %s", projectDirPath)
|
||||||
|
|
||||||
// create project directory
|
// create project directory
|
||||||
log.Debug("Creating project directory")
|
log.Infof("Creating project directory")
|
||||||
|
|
||||||
dirCreated, err := helpers.CheckAndCreateDir(projectDirPath)
|
dirCreated, err := helpers.CheckAndCreateDir(projectDirPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -158,15 +159,26 @@ func runInitAction(cmd *cobra.Command, args []string) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// move to project directory
|
// Move to project directory.
|
||||||
|
log.Infof("Moving to the project directory: %s", userInput.ProjectDirectory)
|
||||||
|
|
||||||
err = os.Chdir(projectDirPath)
|
err = os.Chdir(projectDirPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Errorf("Fail to move to project directory. The following error happen: %s", err.Error())
|
log.Errorf("Fail to move to project directory. The following error happen: %s", err.Error())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// XXX:
|
// Execute git init.
|
||||||
// git init
|
log.Info("Initializing Git")
|
||||||
// create .gouick
|
|
||||||
// move templated file
|
gitinit := exec.Command("git", "init")
|
||||||
|
_, err = gitinit.Output()
|
||||||
|
if err != nil {
|
||||||
|
log.Errorf("Fail to git init. The following error happen: %s", err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
log.Info("Creating gouick configuration file")
|
||||||
|
|
||||||
|
log.Info("Creating API skeleton")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user