Skip to content

Commit bdb2e15

Browse files
authored
fix(cli): fixes incorrect writing of bundle files (#106)
1 parent a483245 commit bdb2e15

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

cli/pkg/deployment/gitops.go

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -93,22 +93,9 @@ func (g *GitopsDeployer) Deploy() error {
9393
}
9494

9595
g.logger.Info("Writing bundle to filesystem", "path", bundlePath)
96-
exists, err = fileExists(g.fs, bundlePath)
96+
bundleFile, err := g.fs.Create(bundlePath)
9797
if err != nil {
98-
return fmt.Errorf("could not check if bundle exists: %w", err)
99-
}
100-
101-
var bundleFile billy.File
102-
if exists {
103-
bundleFile, err = g.fs.OpenFile(bundlePath, os.O_RDWR, os.ModePerm)
104-
if err != nil {
105-
return fmt.Errorf("could not open bundle file: %w", err)
106-
}
107-
} else {
108-
bundleFile, err = g.fs.Create(bundlePath)
109-
if err != nil {
110-
return fmt.Errorf("could not create bundle file: %w", err)
111-
}
98+
return fmt.Errorf("could not create bundle file: %w", err)
11299
}
113100

114101
_, err = bundleFile.Write(bundle)

0 commit comments

Comments
 (0)