Skip to content

Commit f3ecdaf

Browse files
authored
Merge pull request ActiveState#3302 from ActiveState/version/0-44-0-RC4
Version 0.44.0-RC4
2 parents aba4c75 + da65969 commit f3ecdaf

File tree

3 files changed

+4
-21
lines changed

3 files changed

+4
-21
lines changed

cmd/state-installer/cmd.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,6 @@ func execute(out output.Outputer, cfg *config.Instance, an analytics.Dispatcher,
288288
}
289289
// Older state tools did not bake in meta information, in this case we allow overwriting regardless of channel
290290
targetingSameChannel := installedChannel == "" || installedChannel == constants.ChannelName
291-
stateToolInstalledAndFunctional := stateToolInstalled && installationIsOnPATH(params.path) && targetingSameChannel
292291

293292
// If this is a fresh installation we ensure that the target directory is empty
294293
if !stateToolInstalled && fileutils.DirExists(params.path) && !params.force {
@@ -310,9 +309,9 @@ func execute(out output.Outputer, cfg *config.Instance, an analytics.Dispatcher,
310309
}
311310
an.Event(anaConst.CatInstallerFunnel, route)
312311

313-
// Check if state tool already installed and functional
314-
if stateToolInstalledAndFunctional && !params.isUpdate && !params.force {
315-
logging.Debug("Cancelling out because State Tool is already installed and functional")
312+
// Check if state tool already installed
313+
if !params.isUpdate && !params.force && stateToolInstalled && !targetingSameChannel {
314+
logging.Debug("Cancelling out because State Tool is already installed")
316315
out.Print(fmt.Sprintf("State Tool Package Manager is already installed at [NOTICE]%s[/RESET]. To reinstall use the [ACTIONABLE]--force[/RESET] flag.", installPath))
317316
an.Event(anaConst.CatInstallerFunnel, "already-installed")
318317
params.isUpdate = true

cmd/state-installer/installer.go

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -254,19 +254,3 @@ func installedOnPath(installRoot, channel string) (bool, string, error) {
254254

255255
return false, installRoot, nil
256256
}
257-
258-
// installationIsOnPATH returns whether the installed State Tool root is on $PATH or %PATH%.
259-
func installationIsOnPATH(installRoot string) bool {
260-
// This is not using appinfo on purpose because we want to deal with legacy installation formats, which appinfo does not
261-
stateCmd := constants.StateCmd + osutils.ExeExtension
262-
263-
exeOnPATH := osutils.FindExeOnPATH(stateCmd)
264-
if exeOnPATH == "" {
265-
return false
266-
}
267-
onPATH, err := fileutils.PathContainsParent(exeOnPATH, installRoot)
268-
if err != nil {
269-
multilog.Error("Unable to determine if state tool on PATH is in path to install to: %v", err)
270-
}
271-
return onPATH
272-
}

version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.44.0-RC3
1+
0.44.0-RC4

0 commit comments

Comments
 (0)