Skip to content

Commit a9c7f48

Browse files
committed
do not force project dir for remote configs
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
1 parent 61f9cea commit a9c7f48

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

cli/options.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,12 +393,11 @@ func (o *ProjectOptions) GetWorkingDir() (string, error) {
393393
if o.WorkingDir != "" {
394394
return filepath.Abs(o.WorkingDir)
395395
}
396-
PATH:
397396
for _, path := range o.ConfigPaths {
398397
if path != "-" {
399398
for _, l := range o.ResourceLoaders {
400399
if l.Accept(path) {
401-
break PATH
400+
return l.Dir(path), nil
402401
}
403402
}
404403
absPath, err := filepath.Abs(path)

loader/loader.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -293,17 +293,13 @@ func LoadConfigFiles(ctx context.Context, configFiles []string, workingDir strin
293293
}
294294

295295
for _, loader := range opts.ResourceLoaders {
296-
_, isLocalResourceLoader := loader.(localResourceLoader)
297296
if !loader.Accept(p) {
298297
continue
299298
}
300299
local, err := loader.Load(ctx, p)
301300
if err != nil {
302301
return nil, err
303302
}
304-
if config.WorkingDir == "" && !isLocalResourceLoader {
305-
config.WorkingDir = filepath.Dir(local)
306-
}
307303
abs, err := filepath.Abs(local)
308304
if err != nil {
309305
abs = local

0 commit comments

Comments
 (0)