mirror of
https://github.com/kevin-DL/revel-cmd.git
synced 2026-01-11 18:54:31 +00:00
Updated shared build environments
Updated check for errors. Updated go.mod Added .vscode launch
This commit is contained in:
@@ -25,6 +25,7 @@ import (
|
||||
)
|
||||
|
||||
var importErrorPattern = regexp.MustCompile("cannot find package \"([^\"]+)\"")
|
||||
var importErrorPattern2 = regexp.MustCompile("no required module provides package ([^;]+)+")
|
||||
|
||||
type ByString []*model.TypeInfo
|
||||
|
||||
@@ -210,6 +211,9 @@ func Build(c *model.CommandConfig, paths *model.RevelContainer) (_ *App, err err
|
||||
|
||||
// See if it was an import error that we can go get.
|
||||
matches := importErrorPattern.FindAllStringSubmatch(stOutput, -1)
|
||||
if matches == nil {
|
||||
matches = importErrorPattern2.FindAllStringSubmatch(stOutput, -1)
|
||||
}
|
||||
utils.Logger.Info("Build failed checking for missing imports", "message", stOutput, "missing_imports", len(matches))
|
||||
if matches == nil {
|
||||
utils.Logger.Info("Build failed no missing imports", "message", stOutput)
|
||||
@@ -226,6 +230,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")
|
||||
utils.Logger.Error("Unable to resolve package", "package", pkgName, "error", err)
|
||||
return nil, newCompileError(paths, []byte(err.Error()))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user