From 2cb5f247082623cc66e5ea698bcf1d7807c00b5b Mon Sep 17 00:00:00 2001 From: Jan De Dobbeleer Date: Thu, 13 Oct 2022 20:20:02 +0200 Subject: [PATCH] fix(path): correct path for env.DirIsWritable --- src/environment/shell_unix.go | 2 +- src/segments/path.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/environment/shell_unix.go b/src/environment/shell_unix.go index 7a7a68bc..0c23de76 100644 --- a/src/environment/shell_unix.go +++ b/src/environment/shell_unix.go @@ -125,7 +125,7 @@ func (env *ShellEnvironment) LookWinAppPath(file string) (string, error) { } func (env *ShellEnvironment) DirIsWritable(path string) bool { - defer env.Trace(time.Now(), "DirIsWritable") + defer env.Trace(time.Now(), "DirIsWritable", path) info, err := os.Stat(path) if err != nil { env.Log(Error, "DirIsWritable", err.Error()) diff --git a/src/segments/path.go b/src/segments/path.go index d506cdf1..6dd48276 100644 --- a/src/segments/path.go +++ b/src/segments/path.go @@ -84,7 +84,7 @@ func (pt *Path) Enabled() bool { pt.Location = pt.pwd } pt.StackCount = pt.env.StackCount() - pt.Writable = pt.env.DirIsWritable(pt.pwd) + pt.Writable = pt.env.DirIsWritable(pt.env.Pwd()) return true }