Skip to content

Commit

Permalink
Don't ask to install to PATH when in a non-writable PATH location
Browse files Browse the repository at this point in the history
  • Loading branch information
dshafik committed Nov 7, 2017
1 parent 0fa6b4e commit 66a2333
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions firstrun.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,17 @@ func firstRun() error {
}

for _, path := range paths {
if checkAccess(path, ACCESS_W_OK) != nil || len(strings.TrimSpace(path)) == 0 {
if len(strings.TrimSpace(path)) == 0 {
continue
}

if runtime.GOOS == "windows" {
path = strings.ToLower(path)
}

writablePaths = append(writablePaths, path)
if checkAccess(path, ACCESS_W_OK) != nil {
writablePaths = append(writablePaths, path)
}

if path == dirPath {
inPath = true
Expand Down

0 comments on commit 66a2333

Please sign in to comment.