expand ~ in env file values and sandbox paths

This commit is contained in:
Levi Neely 2026-05-20 18:34:00 +02:00
parent fa9c98fb05
commit 66d9d0502d
2 changed files with 4 additions and 1 deletions

View File

@ -110,6 +110,7 @@ func expandPath(pattern, cwd string) string {
return match
})
s = paths.ExpandHome(s)
return s
}

4
pkg/env/env.go vendored
View File

@ -9,6 +9,8 @@ import (
"os"
"path/filepath"
"strings"
"ollie/pkg/paths"
)
// managed is the ordered list of env vars that ollie exposes to frontends.
@ -82,7 +84,7 @@ func LoadFile(path string) {
}
v = strings.TrimSpace(v)
if k != "" && os.Getenv(k) == "" {
os.Setenv(k, v) //nolint:errcheck
os.Setenv(k, paths.ExpandHome(v)) //nolint:errcheck
}
}
}