Skip to content

Commit

Permalink
Use installation package for directory determination.
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchell-as committed Dec 11, 2023
1 parent 26b7b08 commit 3fb5ce7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/runners/clean/run_win.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
svcApp "github.com/ActiveState/cli/cmd/state-svc/app"
"github.com/ActiveState/cli/internal/assets"
"github.com/ActiveState/cli/internal/config"
"github.com/ActiveState/cli/internal/constants"
"github.com/ActiveState/cli/internal/errs"
"github.com/ActiveState/cli/internal/installation"
"github.com/ActiveState/cli/internal/installation/storage"
Expand Down Expand Up @@ -120,7 +121,10 @@ func removeInstall(logFile string, params *UninstallParams, cfg *config.Instance
// Schedule removal of the entire branch name directory.
// This is because Windows often thinks the installation.InstallDirMarker and
// constants.StateInstallerCmd files are still in use.
branchDir := filepath.Dir(filepath.Dir(stateExec))
branchDir, err := installation.InstallPathForBranch(constants.BranchName)
if err != nil {
return errs.Wrap(err, "Unable to determine branch directory to remove")
}
paths := []string{stateExec, branchDir}
if params.All {
paths = append(paths, cfg.ConfigPath()) // also remove the config directory
Expand Down

0 comments on commit 3fb5ce7

Please sign in to comment.