mirror of
https://github.com/kevin-DL/revel-cmd.git
synced 2026-01-23 15:31:26 +00:00
Updated formating
Ran through testing individually for vendored Revel applications
This commit is contained in:
@@ -29,10 +29,10 @@ import (
|
||||
type (
|
||||
// The version container
|
||||
VersionCommand struct {
|
||||
Command *model.CommandConfig // The command
|
||||
revelVersion *model.Version // The Revel framework version
|
||||
modulesVersion *model.Version // The Revel modules version
|
||||
cmdVersion *model.Version // The tool version
|
||||
Command *model.CommandConfig // The command
|
||||
revelVersion *model.Version // The Revel framework version
|
||||
modulesVersion *model.Version // The Revel modules version
|
||||
cmdVersion *model.Version // The tool version
|
||||
}
|
||||
)
|
||||
|
||||
@@ -74,10 +74,10 @@ func (v *VersionCommand) RunWith(c *model.CommandConfig) (err error) {
|
||||
versionInfo := ""
|
||||
for x := 0; x < 2 && needsUpdates; x++ {
|
||||
needsUpdates = false
|
||||
versionInfo, needsUpdates = v.doRepoCheck(x==0)
|
||||
versionInfo, needsUpdates = v.doRepoCheck(x == 0)
|
||||
}
|
||||
|
||||
fmt.Printf("%s\n\nGo Location:%s\n\n",versionInfo,c.GoCmd)
|
||||
fmt.Printf("%s\n\nGo Location:%s\n\n", versionInfo, c.GoCmd)
|
||||
cmd := exec.Command(c.GoCmd, "version")
|
||||
cmd.Stdout = os.Stdout
|
||||
if e := cmd.Start(); e != nil {
|
||||
@@ -112,7 +112,7 @@ func (v *VersionCommand) doRepoCheck(updateLibs bool) (versionInfo string, needs
|
||||
// Only do an update on the first loop, and if specified to update
|
||||
shouldUpdate := updateLibs && v.Command.Version.Update
|
||||
if v.Command.Version.Update {
|
||||
if localVersion == nil || (versonFromRepo != nil && versonFromRepo.Newer(localVersion)) {
|
||||
if localVersion == nil || (versonFromRepo != nil && versonFromRepo.Newer(localVersion)) {
|
||||
needsUpdate = true
|
||||
if shouldUpdate {
|
||||
v.doUpdate(title, repo, localVersion, versonFromRepo)
|
||||
@@ -127,7 +127,7 @@ func (v *VersionCommand) doRepoCheck(updateLibs bool) (versionInfo string, needs
|
||||
|
||||
// Checks for updates if needed
|
||||
func (v *VersionCommand) doUpdate(title, repo string, local, remote *model.Version) {
|
||||
utils.Logger.Info("Updating package", "package", title, "repo",repo)
|
||||
utils.Logger.Info("Updating package", "package", title, "repo", repo)
|
||||
fmt.Println("Attempting to update package", title)
|
||||
if err := v.Command.PackageResolver(repo); err != nil {
|
||||
utils.Logger.Error("Unable to update repo", "repo", repo, "error", err)
|
||||
@@ -228,15 +228,15 @@ func (v *VersionCommand) versionFromBytes(sourceStream []byte) (version *model.V
|
||||
}
|
||||
|
||||
// Fetch the local version of revel from the file system
|
||||
func (v *VersionCommand) updateLocalVersions() {
|
||||
func (v *VersionCommand) updateLocalVersions() {
|
||||
v.cmdVersion = &model.Version{}
|
||||
v.cmdVersion.ParseVersion(cmd.Version)
|
||||
v.cmdVersion.BuildDate = cmd.BuildDate
|
||||
v.cmdVersion.MinGoVersion = cmd.MinimumGoVersion
|
||||
|
||||
pathMap, err := utils.FindSrcPaths(v.Command.AppPath,[]string{model.RevelImportPath,model.RevelModulesImportPath}, v.Command.PackageResolver)
|
||||
pathMap, err := utils.FindSrcPaths(v.Command.AppPath, []string{model.RevelImportPath, model.RevelModulesImportPath}, v.Command.PackageResolver)
|
||||
if err != nil {
|
||||
utils.Logger.Warn("Unable to extract version information from Revel library", "path",pathMap[model.RevelImportPath], "error",err)
|
||||
utils.Logger.Warn("Unable to extract version information from Revel library", "path", pathMap[model.RevelImportPath], "error", err)
|
||||
return
|
||||
}
|
||||
utils.Logger.Info("Fullpath to revel modules", "dir", pathMap[model.RevelImportPath])
|
||||
|
||||
Reference in New Issue
Block a user