expand ~ in env file values and sandbox paths
This commit is contained in:
parent
fa9c98fb05
commit
66d9d0502d
|
|
@ -110,6 +110,7 @@ func expandPath(pattern, cwd string) string {
|
|||
return match
|
||||
})
|
||||
|
||||
s = paths.ExpandHome(s)
|
||||
return s
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Reference in New Issue