pkg/environment: Migrate fs functions to fsx

This commit is contained in:
Tom Wiesing 2023-03-02 11:38:30 +01:00
parent 45540ab253
commit 5a43ecfaeb
No known key found for this signature in database
21 changed files with 155 additions and 199 deletions

View file

@ -19,11 +19,12 @@ type Params struct {
// ParamsFromEnv creates a new set of parameters from the environment.
// Uses [ReadBaseDirectory] or falls back to [BaseDirectoryDefault].
func ParamsFromEnv() (params Params, err error) {
var native environment.Environment
// try to read the base directory!
value, err := ReadBaseDirectory(new(environment.Native)) // TODO: Are we sure about the native environment here?
value, err := ReadBaseDirectory(native) // TODO: Are we sure about the native environment here?
switch {
case environment.IsNotExist(err):
case os.IsNotExist(err):
params.ConfigPath = bootstrap.BaseDirectoryDefault
case err == nil:
params.ConfigPath = value