fix(devops): Dockerfile & .local.env support added
Hello World / hello (push) Has been cancelled
Build / test-and-build (scribblers-linux-x64, ubuntu-latest) (push) Has been cancelled
Build / test-and-build (scribblers-macos-x64, macos-latest) (push) Has been cancelled
Build / test-and-build (scribblers-x64.exe, windows-latest) (push) Has been cancelled
Hello World / hello (push) Has been cancelled
Build / test-and-build (scribblers-linux-x64, ubuntu-latest) (push) Has been cancelled
Build / test-and-build (scribblers-macos-x64, macos-latest) (push) Has been cancelled
Build / test-and-build (scribblers-x64.exe, windows-latest) (push) Has been cancelled
This commit is contained in:
@@ -133,6 +133,19 @@ func Load() (*Config, error) {
|
||||
maps.Copy(envVars, envFileContent)
|
||||
}
|
||||
|
||||
dotEnvPath = ".local.env"
|
||||
if _, err := os.Stat(dotEnvPath); err != nil {
|
||||
if !os.IsNotExist(err) {
|
||||
return nil, fmt.Errorf("error checking for existence of .local.env file: %w", err)
|
||||
}
|
||||
} else {
|
||||
envFileContent, err := gotenv.Read(dotEnvPath)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error reading .local.env file: %w", err)
|
||||
}
|
||||
maps.Copy(envVars, envFileContent)
|
||||
}
|
||||
|
||||
// Add local environment variables to EnvVars map
|
||||
for _, keyValuePair := range os.Environ() {
|
||||
pair := strings.SplitN(keyValuePair, "=", 2)
|
||||
|
||||
Reference in New Issue
Block a user