mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-12 14:37:08 +08:00
bumpo compose-go to v2.1.0
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
This commit is contained in:
17
vendor/github.com/compose-spec/compose-go/v2/loader/loader.go
generated
vendored
17
vendor/github.com/compose-spec/compose-go/v2/loader/loader.go
generated
vendored
@ -148,8 +148,11 @@ func (l localResourceLoader) Load(_ context.Context, p string) (string, error) {
|
||||
return l.abs(p), nil
|
||||
}
|
||||
|
||||
func (l localResourceLoader) Dir(path string) string {
|
||||
path = l.abs(filepath.Dir(path))
|
||||
func (l localResourceLoader) Dir(originalPath string) string {
|
||||
path := l.abs(originalPath)
|
||||
if !l.isDir(path) {
|
||||
path = l.abs(filepath.Dir(originalPath))
|
||||
}
|
||||
rel, err := filepath.Rel(l.WorkingDir, path)
|
||||
if err != nil {
|
||||
return path
|
||||
@ -157,6 +160,14 @@ func (l localResourceLoader) Dir(path string) string {
|
||||
return rel
|
||||
}
|
||||
|
||||
func (l localResourceLoader) isDir(path string) bool {
|
||||
fileInfo, err := os.Stat(path)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
return fileInfo.IsDir()
|
||||
}
|
||||
|
||||
func (o *Options) clone() *Options {
|
||||
return &Options{
|
||||
SkipValidation: o.SkipValidation,
|
||||
@ -452,7 +463,7 @@ func loadYamlModel(ctx context.Context, config types.ConfigDetails, opts *Option
|
||||
}
|
||||
}
|
||||
|
||||
dict, err = transform.Canonical(dict)
|
||||
dict, err = transform.Canonical(dict, opts.SkipInterpolation)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user