fix(path): fallback to env.Pwd() for .Location

resolves #3010
This commit is contained in:
Jan De Dobbeleer 2022-10-24 20:18:30 +02:00 committed by Jan De Dobbeleer
parent 972c3c1048
commit f74855fc3c

View file

@ -78,13 +78,14 @@ func (pt *Path) Enabled() bool {
return false return false
} }
pt.setStyle() pt.setStyle()
pwd := pt.env.Pwd()
if pt.env.IsWsl() { if pt.env.IsWsl() {
pt.Location, _ = pt.env.RunCommand("wslpath", "-m", pt.env.Pwd()) pt.Location, _ = pt.env.RunCommand("wslpath", "-m", pwd)
} else { } else {
pt.Location = pt.pwd pt.Location = pwd
} }
pt.StackCount = pt.env.StackCount() pt.StackCount = pt.env.StackCount()
pt.Writable = pt.env.DirIsWritable(pt.env.Pwd()) pt.Writable = pt.env.DirIsWritable(pwd)
return true return true
} }