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 (
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
@ -145,7 +146,7 @@ func runInitAction(cmd *cobra.Command, args []string) {
|
||||
log.Debugf("Our project directory path is: %s", projectDirPath)
|
||||
|
||||
// create project directory
|
||||
log.Debug("Creating project directory")
|
||||
log.Infof("Creating project directory")
|
||||
|
||||
dirCreated, err := helpers.CheckAndCreateDir(projectDirPath)
|
||||
if err != nil {
|
||||
@ -158,15 +159,26 @@ func runInitAction(cmd *cobra.Command, args []string) {
|
||||
return
|
||||
}
|
||||
|
||||
// move to project directory
|
||||
// Move to project directory.
|
||||
log.Infof("Moving to the project directory: %s", userInput.ProjectDirectory)
|
||||
|
||||
err = os.Chdir(projectDirPath)
|
||||
if err != nil {
|
||||
log.Errorf("Fail to move to project directory. The following error happen: %s", err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// XXX:
|
||||
// git init
|
||||
// create .gouick
|
||||
// move templated file
|
||||
// Execute git init.
|
||||
log.Info("Initializing Git")
|
||||
|
||||
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