Updated Revel command

Added a check to see if harness had already started, saves a recompile on load
Added check to source info for local import renames
Removed the go/build check for path and just check existence of the path
Formatting updates
This commit is contained in:
notzippy@gmail.com
2020-05-13 22:26:05 -07:00
parent 741f49236a
commit 4bab4409b9
7 changed files with 104 additions and 50 deletions

View File

@@ -11,9 +11,7 @@ import (
"github.com/revel/cmd/harness"
"github.com/revel/cmd/model"
"github.com/revel/cmd/utils"
"go/build"
"os"
"path/filepath"
)
var cmdRun = &Command{
@@ -116,10 +114,7 @@ func updateRunConfig(c *model.CommandConfig, args []string) bool {
// Returns true if this is an absolute path or a relative gopath
func runIsImportPath(pathToCheck string) bool {
if _, err := build.Import(pathToCheck, "", build.FindOnly); err == nil {
return true
}
return filepath.IsAbs(pathToCheck)
return utils.DirExists(pathToCheck)
}
// Called to run the app