fix template --output-dir issue

Signed-off-by: yxxhero <aiopsclub@163.com>
pull/11487/head
yxxhero 2 years ago committed by xiongxiong yuan
parent 774c6ce703
commit 1c25a1fadd

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

Loading…
Cancel
Save