|
|
@ -106,12 +106,17 @@ func Save(c *chart.Chart, outDir string) (string, error) {
|
|
|
|
|
|
|
|
|
|
|
|
filename := fmt.Sprintf("%s-%s.tgz", c.Name(), c.Metadata.Version)
|
|
|
|
filename := fmt.Sprintf("%s-%s.tgz", c.Name(), c.Metadata.Version)
|
|
|
|
filename = filepath.Join(outDir, filename)
|
|
|
|
filename = filepath.Join(outDir, filename)
|
|
|
|
if stat, err := os.Stat(filepath.Dir(filename)); os.IsNotExist(err) {
|
|
|
|
dir := filepath.Dir(filename)
|
|
|
|
if err := os.MkdirAll(filepath.Dir(filename), 0755); err != nil {
|
|
|
|
if stat, err := os.Stat(dir); err != nil {
|
|
|
|
return "", err
|
|
|
|
if os.IsNotExist(err) {
|
|
|
|
|
|
|
|
if err2 := os.MkdirAll(dir, 0755); err2 != nil {
|
|
|
|
|
|
|
|
return "", err2
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
return "", errors.Wrapf(err, "stat %s", dir)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if !stat.IsDir() {
|
|
|
|
} else if !stat.IsDir() {
|
|
|
|
return "", errors.Errorf("is not a directory: %s", filepath.Dir(filename))
|
|
|
|
return "", errors.Errorf("is not a directory: %s", dir)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
f, err := os.Create(filename)
|
|
|
|
f, err := os.Create(filename)
|
|
|
|