Move path manipulation to spec.Save

Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
Evan Lezar
2023-03-01 07:50:46 +02:00
parent 221781bd0b
commit 314059fcf0
2 changed files with 17 additions and 13 deletions

View File

@@ -167,15 +167,7 @@ func (m command) run(c *cli.Context, cfg *config) error {
return nil
}
path := cfg.output
if filepath.Clean(filepath.Dir(path)) == "." {
pwd, err := os.Getwd()
if err != nil {
return fmt.Errorf("failed to get current working directory: %v", err)
}
path = filepath.Join(pwd, path)
}
return spec.Save(path)
return spec.Save(cfg.output)
}
func formatFromFilename(filename string) string {