From 1c25a1fadd1f5f11fae9ea85f981ba0947ac97cb Mon Sep 17 00:00:00 2001 From: yxxhero Date: Sat, 29 Oct 2022 22:05:17 +0800 Subject: [PATCH] fix template --output-dir issue Signed-off-by: yxxhero --- cmd/helm/template.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/helm/template.go b/cmd/helm/template.go index ce2be55bcf4..0ddd0c5514f 100644 --- a/cmd/helm/template.go +++ b/cmd/helm/template.go @@ -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 } }