compose-go
compose-go copied to clipboard
Fix nested include with env files
Currently in model loading, workingDir refers to the relative directory to the workingDir of upper caller, instead of the process's current working directory. This makes operations like os.Stat(filepath.Join(workingDir, f)) will fail if invoked on such workingDir in nested include/extends.
This PR fixes such calling in ApplyInclude's env file handling logic, to use options.ResourceLoaders to retrieve the correct absolute path, instead of relying on filepath.Join(workingDir, f).
This PR will be unnecessary once https://github.com/Vigilans/compose-go/pull/3 is accepted, since workingDir is ensured to be absolute directory there.
(loader's workingDir has to be absolute, or loader.Load(ctx, f) + loader.Dir(f) will prepend workingDir to relative path twice)