Skip to content

Commit 055ae03

Browse files
simplify pull file
1 parent 6a62db3 commit 055ae03

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/content_manager.go

+5
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,11 @@ func (cm *ContentManager) PullFile(file string, clean bool, opts PackageCreateOp
117117
return err
118118
}
119119
cleanFile := determineCleanFile(file)
120+
if pathx.Exists(file) && file != cleanFile {
121+
if err := os.Remove(file); err != nil {
122+
return err
123+
}
124+
}
120125
_, jcrPath, _ := strings.Cut(cleanFile, content.JCRRoot)
121126
if err := filex.Copy(filepath.Join(workDir, content.JCRRoot, jcrPath), cleanFile, true); err != nil {
122127
return err

0 commit comments

Comments
 (0)