Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Enhancement #136

Merged
merged 1 commit into from
Sep 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion harness/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
24 changes: 19 additions & 5 deletions revel/new.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}


Expand Down Expand Up @@ -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))
}
}
}

Expand Down Expand Up @@ -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")
Expand Down
1 change: 1 addition & 0 deletions revel/skeleton/messages/sample.en
Original file line number Diff line number Diff line change
Expand Up @@ -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]