From 66a233305481861dab71ccf629be4dcc12f734e0 Mon Sep 17 00:00:00 2001 From: Davey Shafik Date: Mon, 6 Nov 2017 20:35:19 -0800 Subject: [PATCH] Don't ask to install to `PATH` when in a non-writable `PATH` location --- firstrun.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/firstrun.go b/firstrun.go index d636661..02a967e 100644 --- a/firstrun.go +++ b/firstrun.go @@ -37,7 +37,7 @@ 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 } @@ -45,7 +45,9 @@ func firstRun() error { path = strings.ToLower(path) } - writablePaths = append(writablePaths, path) + if checkAccess(path, ACCESS_W_OK) != nil { + writablePaths = append(writablePaths, path) + } if path == dirPath { inPath = true