mirror of
https://github.com/kevin-DL/revel-cmd.git
synced 2026-01-11 18:54:31 +00:00
Corrected version detection, so that equal versions match
This commit is contained in:
@@ -21,6 +21,7 @@ type Version struct {
|
||||
var frameworkCompatibleRangeList = [][]string{
|
||||
{"0.0.0", "0.20.0"}, // minimum Revel version to use with this version of the tool
|
||||
{"0.19.99", "0.30.0"}, // Compatible with Framework V 0.19.99 - 0.30.0
|
||||
{"1.0.0", "1.1.0"}, // Compatible with Framework V 1.0 - 1.1
|
||||
}
|
||||
|
||||
// Parses a version like v1.2.3a or 1.2
|
||||
@@ -70,6 +71,7 @@ func (v *Version) CompatibleFramework(c *CommandConfig) error {
|
||||
if !v.Newer(start) || v.Newer(end) {
|
||||
continue
|
||||
}
|
||||
|
||||
// Framework is older then 0.20, turn on historic mode
|
||||
if i == 0 {
|
||||
c.HistoricMode = true
|
||||
@@ -109,7 +111,7 @@ func (v *Version) Newer(o *Version) bool {
|
||||
if v.Maintenance != o.Maintenance {
|
||||
return v.Maintenance > o.Maintenance
|
||||
}
|
||||
return false
|
||||
return true
|
||||
}
|
||||
|
||||
// Convert the version to a string
|
||||
|
||||
@@ -239,8 +239,8 @@ func (v *VersionCommand) updateLocalVersions() {
|
||||
utils.Logger.Warn("Unable to extract version information from Revel library", "path",pathMap[model.RevelImportPath], "error",err)
|
||||
return
|
||||
}
|
||||
utils.Logger.Info("Fullpath to revel", "dir", pathMap[model.RevelModulesImportPath])
|
||||
v.revelVersion, err = v.versionFromFilepath(pathMap[model.RevelModulesImportPath])
|
||||
utils.Logger.Info("Fullpath to revel modules", "dir", pathMap[model.RevelImportPath])
|
||||
v.revelVersion, err = v.versionFromFilepath(pathMap[model.RevelImportPath])
|
||||
if err != nil {
|
||||
utils.Logger.Warn("Unable to extract version information from Revel", "error,err")
|
||||
}
|
||||
|
||||
@@ -352,7 +352,7 @@ func findSrcPaths(appPath string, packagesList []string) (sourcePathsmap map[str
|
||||
sourcePathsmap = map[string]string{}
|
||||
|
||||
pkgs, err := packages.Load(config, packagesList...)
|
||||
Logger.Info("Loaded packegs ", "len results", len(pkgs), "error",err,"basedir",appPath)
|
||||
Logger.Info("Loaded packages ", "len results", len(pkgs), "error",err,"basedir",appPath)
|
||||
for _, packageName := range packagesList {
|
||||
found := false
|
||||
log:= Logger.New("seeking",packageName)
|
||||
|
||||
Reference in New Issue
Block a user