From 03f1c3b44c0531bf8696452b7e04536fdb59fc2d Mon Sep 17 00:00:00 2001 From: Joe Lim <50560759+joelim-work@users.noreply.github.com> Date: Sun, 18 Jun 2023 16:09:42 +1000 Subject: [PATCH] Add quote string --- main.go | 2 +- os.go | 4 ++++ os_windows.go | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index fa267e8e..22667c99 100644 --- a/main.go +++ b/main.go @@ -85,7 +85,7 @@ func exportEnvVars() { log.Printf("getting path to lf binary: %s", err) lfPath = "lf" } - os.Setenv("lf", lfPath) + os.Setenv("lf", quoteString(lfPath)) } // used by exportOpts below diff --git a/os.go b/os.go index 46ee6940..05c71d2d 100644 --- a/os.go +++ b/os.go @@ -232,3 +232,7 @@ func exportFiles(f string, fs []string, pwd string) { os.Setenv("fx", envFiles) } } + +func quoteString(s string) string { + return s +} diff --git a/os_windows.go b/os_windows.go index edb85745..5d006980 100644 --- a/os_windows.go +++ b/os_windows.go @@ -195,3 +195,7 @@ func exportFiles(f string, fs []string, pwd string) { os.Setenv("fx", envFiles) } } + +func quoteString(s string) string { + return fmt.Sprintf(`"%s"`, s) +}