Skip to content

Commit

Permalink
Merge pull request #3563 from ActiveState/mitchell/dx-3132
Browse files Browse the repository at this point in the history
Log %PATH% that did not contain powershell to aid in diagnosing rollbar issue.
  • Loading branch information
mitchell-as authored Oct 28, 2024
2 parents 7aa9e61 + 4886da9 commit 31d8c7b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/osutils/shortcut/shortcut_windows.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package shortcut

import (
"errors"
"fmt"
"os"
"os/exec"
Expand Down Expand Up @@ -74,6 +75,9 @@ func (s *Shortcut) Enable() error {
cmd := exec.Command("powershell.exe", args...)
out, err := cmd.CombinedOutput()
if err != nil {
if errors.Is(err, exec.ErrNotFound) {
return locale.WrapError(err, "err_prepare_shortcut_powershell_not_found", "Could not create shortcut because powershell was not found on your PATH (searched '{{.V0}}')", os.Getenv("PATH"))
}
return locale.WrapError(err, "err_clean_start", "Could not create shortcut. Received error: {{.V0}}", string(out))
}

Expand Down

0 comments on commit 31d8c7b

Please sign in to comment.