compose-go icon indicating copy to clipboard operation
compose-go copied to clipboard

Fix nested include with env files

Open Vigilans opened this issue 11 months ago • 1 comments

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).

Vigilans avatar Dec 19 '24 03:12 Vigilans

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)

Vigilans avatar Jan 08 '25 09:01 Vigilans