Skip to content

Commit

Permalink
simplify pull file
Browse files Browse the repository at this point in the history
  • Loading branch information
dominik-przybyl-wttech committed Aug 23, 2024
1 parent 6a62db3 commit 055ae03
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/content_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ func (cm *ContentManager) PullFile(file string, clean bool, opts PackageCreateOp
return err
}
cleanFile := determineCleanFile(file)
if pathx.Exists(file) && file != cleanFile {
if err := os.Remove(file); err != nil {
return err
}
}
_, jcrPath, _ := strings.Cut(cleanFile, content.JCRRoot)
if err := filex.Copy(filepath.Join(workDir, content.JCRRoot, jcrPath), cleanFile, true); err != nil {
return err
Expand Down

0 comments on commit 055ae03

Please sign in to comment.