mirror of
https://github.com/kevin-DL/revel-cmd.git
synced 2026-01-11 18:54:31 +00:00
Fixed issue with new and run flag
Updated tests to run final test in non gopath, with new name
This commit is contained in:
@@ -72,7 +72,7 @@ func newApp(c *model.CommandConfig) (err error) {
|
||||
// Check for an existing folder so we don't clobber it
|
||||
_, err = build.Import(c.ImportPath, "", build.FindOnly)
|
||||
if err == nil || !utils.Empty(c.AppPath) {
|
||||
return utils.NewBuildError("Abort: Import path already exists.", "path", c.ImportPath)
|
||||
return utils.NewBuildError("Abort: Import path already exists.", "path", c.ImportPath, "apppath", c.AppPath)
|
||||
}
|
||||
|
||||
// checking and setting skeleton
|
||||
@@ -112,6 +112,10 @@ func newApp(c *model.CommandConfig) (err error) {
|
||||
fmt.Fprintln(os.Stdout, "Your application has been created in:\n ", c.AppPath)
|
||||
// Check to see if it should be run right off
|
||||
if c.New.Run {
|
||||
// Need to prep the run command
|
||||
c.Run.ImportPath = c.ImportPath
|
||||
updateRunConfig(c,nil)
|
||||
c.UpdateImportPath()
|
||||
runApp(c)
|
||||
} else {
|
||||
fmt.Fprintln(os.Stdout, "\nYou can run it with:\n revel run -a ", c.ImportPath)
|
||||
|
||||
@@ -34,8 +34,8 @@ func TestVersion(t *testing.T) {
|
||||
a.Nil(main.Commands[model.VERSION].RunWith(c), "Failed to run version-test")
|
||||
})
|
||||
if !t.Failed() {
|
||||
if err := os.RemoveAll(gopath); err != nil {
|
||||
a.Fail("Failed to remove test path")
|
||||
if err := os.RemoveAll(gopath); err != nil && err!=os.ErrNotExist {
|
||||
a.Fail("Failed to remove test path",err.Error())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user