mirror of
https://github.com/kevin-DL/revel-cmd.git
synced 2026-01-11 18:54:31 +00:00
Compare commits
5 Commits
v1.1.0
...
hotfix/v1.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f090e4b4a7 | ||
|
|
4950c86e82 | ||
|
|
cedce5f9fb | ||
|
|
d83d2d5891 | ||
|
|
55b736e588 |
2
.vscode/tasks.json
vendored
2
.vscode/tasks.json
vendored
@@ -6,7 +6,7 @@
|
||||
{
|
||||
"label": "Clean-Test-Project",
|
||||
"type": "shell",
|
||||
"command": "rm -rf ${workspaceRoot}/.temp/revel/testproject"
|
||||
"command": "rm -rf ${workspaceRoot}/.temp/revel/reveltest"
|
||||
},
|
||||
{
|
||||
"label": "Update Go Mod",
|
||||
|
||||
9
go.mod
9
go.mod
@@ -2,6 +2,11 @@ module github.com/revel/cmd
|
||||
|
||||
go 1.17
|
||||
|
||||
retract (
|
||||
v1.1.0 // v1.1.0-1.1.1 are failed releases
|
||||
v1.1.1
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/BurntSushi/toml v1.0.0 // indirect
|
||||
github.com/agtorre/gocolorize v1.0.0
|
||||
@@ -15,10 +20,10 @@ require (
|
||||
github.com/myesui/uuid v1.0.0 // indirect
|
||||
github.com/pkg/errors v0.9.1
|
||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||
github.com/revel/config v1.0.0
|
||||
github.com/revel/config v1.1.0
|
||||
github.com/revel/log15 v2.11.20+incompatible
|
||||
github.com/revel/pathtree v0.0.0-20140121041023-41257a1839e9 // indirect
|
||||
github.com/revel/revel v1.0.0
|
||||
github.com/revel/revel v1.1.0
|
||||
github.com/stretchr/testify v1.7.0
|
||||
github.com/twinj/uuid v1.0.0 // indirect
|
||||
github.com/xeonx/timeago v1.0.0-rc4 // indirect
|
||||
|
||||
@@ -224,10 +224,25 @@ func Build(c *model.CommandConfig, paths *model.RevelContainer) (_ *App, err err
|
||||
utils.Logger.Info("Build failed no missing imports", "message", stOutput)
|
||||
return nil, newCompileError(paths, output)
|
||||
}
|
||||
utils.Logger.Warn("Detected missing packages, importing them", "packages", len(matches))
|
||||
// Reduce the matches down to unique ones
|
||||
missedPkgs := []string{}
|
||||
for _, match := range matches {
|
||||
found := false
|
||||
for _, pkgName := range missedPkgs {
|
||||
if match[1] == pkgName {
|
||||
found = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if !found {
|
||||
missedPkgs = append(missedPkgs, match[1])
|
||||
}
|
||||
}
|
||||
|
||||
utils.Logger.Warn("Detected missing packages, importing them", "packages", len(matches))
|
||||
for _, pkgName := range missedPkgs {
|
||||
// Ensure we haven't already tried to go get it.
|
||||
pkgName := match[1]
|
||||
|
||||
utils.Logger.Info("Trying to import ", "package", pkgName)
|
||||
if _, alreadyTried := gotten[pkgName]; alreadyTried {
|
||||
utils.Logger.Error("Failed to import ", "package", pkgName)
|
||||
@@ -235,7 +250,7 @@ func Build(c *model.CommandConfig, paths *model.RevelContainer) (_ *App, err err
|
||||
}
|
||||
gotten[pkgName] = struct{}{}
|
||||
if err := c.PackageResolver(pkgName); err != nil {
|
||||
panic("failed to resolve")
|
||||
// panic("failed to resolve")
|
||||
utils.Logger.Error("Unable to resolve package", "package", pkgName, "error", err)
|
||||
return nil, newCompileError(paths, []byte(err.Error()))
|
||||
}
|
||||
|
||||
@@ -209,7 +209,7 @@ func NewHarness(c *model.CommandConfig, paths *model.RevelContainer, runMode str
|
||||
// Refresh method rebuilds the Revel application and run it on the given port.
|
||||
// called by the watcher.
|
||||
func (h *Harness) Refresh() (err *utils.SourceError) {
|
||||
t := time.Now();
|
||||
t := time.Now()
|
||||
fmt.Println("Change detected, recompiling")
|
||||
err = h.refresh()
|
||||
if err != nil && !h.ranOnce && h.useProxy {
|
||||
@@ -265,8 +265,8 @@ func (h *Harness) refresh() (err *utils.SourceError) {
|
||||
if len(h.app.PackagePathMap) > 0 {
|
||||
paths, _ = json.Marshal(h.app.PackagePathMap)
|
||||
}
|
||||
|
||||
runMode = fmt.Sprintf(`{"mode":"%s", "specialUseFlag":%v,"packagePathMap":%s}`, h.app.Paths.RunMode, h.config.Verbose[0], string(paths))
|
||||
|
||||
runMode = fmt.Sprintf(`{"mode":"%s", "specialUseFlag":%v,"packagePathMap":%s}`, h.app.Paths.RunMode, h.config.GetVerbose(), string(paths))
|
||||
}
|
||||
|
||||
if err2 := h.app.Cmd(runMode).Start(h.config); err2 != nil {
|
||||
@@ -312,7 +312,7 @@ func (h *Harness) Run() {
|
||||
paths = append(paths, h.paths.CodePaths...)
|
||||
h.watcher = watcher.NewWatcher(h.paths, false)
|
||||
h.watcher.Listen(h, paths...)
|
||||
|
||||
|
||||
go func() {
|
||||
if err := h.Refresh(); err != nil {
|
||||
utils.Logger.Error("Failed to refresh", "error", err)
|
||||
|
||||
@@ -6,10 +6,10 @@ package cmd
|
||||
|
||||
const (
|
||||
// Version current Revel version
|
||||
Version = "1.1.0"
|
||||
Version = "1.1.2"
|
||||
|
||||
// BuildDate latest commit/release date
|
||||
BuildDate = "2022-04-11"
|
||||
BuildDate = "2022-04-12"
|
||||
|
||||
// MinimumGoVersion minimum required Go version for Revel
|
||||
MinimumGoVersion = ">= go1.17"
|
||||
|
||||
Reference in New Issue
Block a user