mirror of
https://github.com/kevin-DL/revel-cmd.git
synced 2026-01-11 18:54:31 +00:00
New Enhancement
Added ability to create a new revel applicaiton without any sources. Automatically download all sources required
This commit is contained in:
@@ -73,7 +73,7 @@ func (cmd AppCmd) Start(c *model.CommandConfig) error {
|
||||
return errors.New("revel/harness: app died reason: " + exitState)
|
||||
|
||||
case <-time.After(60 * time.Second):
|
||||
log.Println("Killing revel server process did not respond after wait timeout.", "processid", cmd.Process.Pid)
|
||||
utils.Logger.Error("Killing revel server process did not respond after wait timeout.", "processid", cmd.Process.Pid)
|
||||
cmd.Kill()
|
||||
return errors.New("revel/harness: app timed out")
|
||||
|
||||
|
||||
24
revel/new.go
24
revel/new.go
@@ -108,8 +108,6 @@ func newApp(c *model.CommandConfig) {
|
||||
if err != nil {
|
||||
utils.Logger.Fatal(string(getOutput))
|
||||
}
|
||||
|
||||
// TODO build.Default.GOPATH = build.Default.GOPATH + string(os.PathListSeparator) + c.ImportPath
|
||||
}
|
||||
|
||||
|
||||
@@ -164,8 +162,12 @@ func setApplicationPath(c *model.CommandConfig) {
|
||||
_, err = build.Import(model.RevelImportPath, "", build.FindOnly)
|
||||
if err != nil {
|
||||
// Go get the revel project
|
||||
|
||||
utils.Logger.Fatal("Abort: Could not find Revel source code:", "error", err)
|
||||
getCmd := exec.Command(c.GoCmd, "get", model.RevelImportPath)
|
||||
utils.Logger.Info("Exec:" + c.GoCmd, "args", getCmd.Args)
|
||||
getOutput, err := getCmd.CombinedOutput()
|
||||
if err != nil {
|
||||
utils.Logger.Fatal("Failed to fetch revel " + model.RevelImportPath, "getOutput", string(getOutput))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -208,7 +210,19 @@ func setSkeletonPath(c *model.CommandConfig) {
|
||||
// use the revel default
|
||||
revelCmdPkg, err := build.Import(RevelCmdImportPath, "", build.FindOnly)
|
||||
if err != nil {
|
||||
utils.Logger.Fatalf("Abort: Could not find Revel Cmd source code: %s\n", err)
|
||||
if err != nil {
|
||||
// Go get the revel project
|
||||
getCmd := exec.Command(c.GoCmd, "get", RevelCmdImportPath + "/revel")
|
||||
utils.Logger.Info("Exec:" + c.GoCmd, "args", getCmd.Args)
|
||||
getOutput, err := getCmd.CombinedOutput()
|
||||
if err != nil {
|
||||
utils.Logger.Fatal("Failed to fetch revel cmd " + RevelCmdImportPath, "getOutput", string(getOutput))
|
||||
}
|
||||
revelCmdPkg, err = build.Import(RevelCmdImportPath, "", build.FindOnly)
|
||||
if err!= nil {
|
||||
utils.Logger.Fatal("Failed to find source of revel cmd " + RevelCmdImportPath, "getOutput", string(getOutput), "error",err, "dir", revelCmdPkg.Dir)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
c.SkeletonPath = filepath.Join(revelCmdPkg.Dir, "revel", "skeleton")
|
||||
|
||||
@@ -4,4 +4,5 @@
|
||||
# See also:
|
||||
# - http://www.rfc-editor.org/rfc/bcp/bcp47.txt
|
||||
# - http://www.w3.org/International/questions/qa-accept-lang-locales
|
||||
[DEFAULT]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user