mirror of
https://github.com/kevin-DL/revel-cmd.git
synced 2026-01-11 18:54:31 +00:00
Revel tool enhancements
* run Command will choose CWD if no additional arguments are supplied * Added Revel version check, compatible lists are in model/version
This commit is contained in:
12
revel/new.go
12
revel/new.go
@@ -119,6 +119,8 @@ func newApp(c *model.CommandConfig) (err error) {
|
||||
if err = setApplicationPath(c); err != nil {
|
||||
return err
|
||||
}
|
||||
// At this point the versions can be set
|
||||
c.SetVersions()
|
||||
|
||||
// checking and setting skeleton
|
||||
if err=setSkeletonPath(c);err!=nil {
|
||||
@@ -189,16 +191,6 @@ func setApplicationPath(c *model.CommandConfig) (err error) {
|
||||
|
||||
c.AppName = filepath.Base(c.AppPath)
|
||||
|
||||
//if c.BasePath == "." {
|
||||
// // we need to remove the a single '.' when
|
||||
// // the app is in the $GOROOT/src directory
|
||||
// c.BasePath = ""
|
||||
//} else {
|
||||
// // we need to append a '/' when the app is
|
||||
// // is a subdirectory such as $GOROOT/src/path/to/revelapp
|
||||
// c.BasePath += "/"
|
||||
//}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ import (
|
||||
"github.com/revel/cmd/model"
|
||||
"github.com/revel/cmd/utils"
|
||||
"go/build"
|
||||
"os"
|
||||
)
|
||||
|
||||
var cmdRun = &Command{
|
||||
@@ -108,7 +109,8 @@ func updateRunConfig(c *model.CommandConfig, args []string) bool {
|
||||
c.Run.Mode = args[0]
|
||||
}
|
||||
case 0:
|
||||
return false
|
||||
// Attempt to set the import path to the current working director.
|
||||
c.Run.ImportPath,_ = os.Getwd()
|
||||
}
|
||||
c.Index = model.RUN
|
||||
return true
|
||||
|
||||
@@ -118,3 +118,4 @@ func versionApp(c *model.CommandConfig) (err error) {
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user