Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions internal/runners/clean/run_win.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ import (
"errors"
"fmt"
"os"
"os/exec"
"path/filepath"

svcApp "github.com/ActiveState/cli/cmd/state-svc/app"
"github.com/ActiveState/cli/internal/assets"
"github.com/ActiveState/cli/internal/condition"
"github.com/ActiveState/cli/internal/config"
"github.com/ActiveState/cli/internal/errs"
"github.com/ActiveState/cli/internal/installation"
Expand Down Expand Up @@ -160,9 +162,16 @@ func removePaths(logFile string, paths ...string) error {
args := []string{"/C", sf.Filename(), logFile, fmt.Sprintf("%d", os.Getpid()), filepath.Base(exe)}
args = append(args, paths...)

_, err = osutils.ExecuteAndForget("cmd.exe", args)
if !condition.OnCI() {
_, err = osutils.ExecuteAndForget("cmd.exe", args)
} else {
var cmd *exec.Cmd
if _, cmd, err = osutils.Execute("cmd.exe", args, nil); err == nil {
err = cmd.Wait()
}
}
if err != nil {
return locale.WrapError(err, "err_clean_start", "Could not start remove direcotry script")
return locale.WrapError(err, "err_clean_start", "Could not start remove directory script")
}

return nil
Expand Down
Loading