fix template --output-dir issue

Signed-off-by: yxxhero <aiopsclub@163.com>
(cherry picked from commit 1c25a1fadd)
release-3.11
yxxhero 2 years ago committed by Matt Farina
parent 293b50c65d
commit d44881ddc0
No known key found for this signature in database
GPG Key ID: 92C44A3D421FF7F9

@ -106,11 +106,15 @@ func newTemplateCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
if client.UseReleaseName {
newDir = filepath.Join(client.OutputDir, client.ReleaseName)
}
_, err := os.Stat(filepath.Join(newDir, m.Path))
if err == nil {
fileWritten[m.Path] = true
}
err = writeToFile(newDir, m.Path, m.Manifest, fileWritten[m.Path])
if err != nil {
return err
}
fileWritten[m.Path] = true
}
}

Loading…
Cancel
Save