Fix quoting of lf environment variable for pwsh (#1990)

* Fix quoting of `lf` environment variable for pwsh

* Simplify lfrc

* typo

* Remove redundant/irrelevant pwsh configs
This commit is contained in:
Joe Lim authored and GitHub committed 2025-05-17 19:30:37 +10:00
1 parent b25976cef7
commit 2494b3f632
3 files changed
+14 -36

No files matched your search

+9 -7
View File
@@ -87,13 +87,6 @@ func exportEnvVars() {
level++
os.Setenv("LF_LEVEL", strconv.Itoa(level))
lfPath, err := os.Executable()
if err != nil {
log.Printf("getting path to lf binary: %s", err)
lfPath = "lf"
}
os.Setenv("lf", quoteString(lfPath))
}
// used by exportOpts below
@@ -150,6 +143,15 @@ func getOptsMap() map[string]string {
return opts
}
func exportLfPath() {
lfPath, err := os.Executable()
if err != nil {
log.Printf("getting path to lf binary: %s", err)
lfPath = "lf"
}
os.Setenv("lf", quoteString(lfPath))
}
func exportOpts() {
for key, value := range getOptsMap() {
os.Setenv(key, value)