Skip to content

Commit d8117a3

Browse files
authored
Merge pull request #186 from notzippy/go-mod
Removed version update from Revel
2 parents 28ac65f + 6371373 commit d8117a3

File tree

5 files changed

+7
-17
lines changed

5 files changed

+7
-17
lines changed

harness/app.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,8 @@ func (cmd AppCmd) Kill() {
135135
// Send an interrupt signal to allow for a graceful shutdown
136136
utils.Logger.Info("Killing revel server pid", "pid", cmd.Process.Pid)
137137
var err error
138-
if runtime.GOOS == "windows" {
138+
if runtime.GOOS != "windows" {
139139
// os.Interrupt is not available on windows
140-
err = cmd.Process.Signal(os.Kill)
141-
} else {
142140
err = cmd.Process.Signal(os.Interrupt)
143141
}
144142

harness/harness.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,11 +332,11 @@ func (h *Harness) Run() {
332332
// Make a new channel to listen for the interrupt event
333333
ch := make(chan os.Signal)
334334
signal.Notify(ch, os.Interrupt, os.Kill)
335+
<-ch
335336
// Kill the app and exit
336337
if h.app != nil {
337338
h.app.Kill()
338339
}
339-
<-ch
340340
os.Exit(1)
341341
}
342342

model/command/version.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,5 @@ package command
22
type (
33
Version struct {
44
ImportCommand
5-
Update bool `short:"u" long:"update" description:"Update the framework and modules" required:"false"`
6-
UpdateVersion string `long:"update-version" description:"Specify the version the revel and app will be switched to" required:"false"`
75
}
86
)

model/command_config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ type (
4848
Vendored bool // True if the application is vendored
4949
PackageResolver func(pkgName string) error // a package resolver for the config
5050
BuildFlags []string `short:"X" long:"build-flags" description:"These flags will be used when building the application. May be specified multiple times, only applicable for Build, Run, Package, Test commands"`
51-
GoModFlags []string `long:"gomod-flags" description:"These flags will execut go mod commands for each flag, this happens during the build process"`
51+
GoModFlags []string `long:"gomod-flags" description:"These flags will execute go mod commands for each flag, this happens during the build process"`
5252
New command.New `command:"new"`
5353
Build command.Build `command:"build"`
5454
Run command.Run `command:"run"`

revel/version.go

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -110,16 +110,6 @@ func (v *VersionCommand) doRepoCheck(updateLibs bool) (versionInfo string, needs
110110
}
111111

112112
// Only do an update on the first loop, and if specified to update
113-
shouldUpdate := updateLibs && v.Command.Version.Update
114-
if v.Command.Version.Update {
115-
if localVersion == nil || (versonFromRepo != nil && versonFromRepo.Newer(localVersion)) {
116-
needsUpdate = true
117-
if shouldUpdate {
118-
v.doUpdate(title, repo, localVersion, versonFromRepo)
119-
v.updateLocalVersions()
120-
}
121-
}
122-
}
123113
versionInfo = versionInfo + v.outputVersion(title, repo, localVersion, versonFromRepo)
124114
}
125115
return
@@ -234,6 +224,10 @@ func (v *VersionCommand) updateLocalVersions() {
234224
v.cmdVersion.BuildDate = cmd.BuildDate
235225
v.cmdVersion.MinGoVersion = cmd.MinimumGoVersion
236226

227+
if v.Command.Version.ImportPath=="" {
228+
return
229+
}
230+
237231
pathMap, err := utils.FindSrcPaths(v.Command.AppPath, []string{model.RevelImportPath, model.RevelModulesImportPath}, v.Command.PackageResolver)
238232
if err != nil {
239233
utils.Logger.Warn("Unable to extract version information from Revel library", "path", pathMap[model.RevelImportPath], "error", err)

0 commit comments

Comments
 (0)