Skip to content

Commit

Permalink
fix: #2315 - deleting files if overwriteExistingFiles is true
Browse files Browse the repository at this point in the history
  • Loading branch information
jmikrut committed Mar 15, 2023
1 parent eabfd91 commit 4d578f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/collections/operations/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ async function update<TSlug extends keyof GeneratedTypes['collections']>(
// Delete any associated files
// /////////////////////////////////////

if (collectionConfig.upload && filesToUpload && filesToUpload.length > 0) {
if (collectionConfig.upload && !overwriteExistingFiles && filesToUpload && filesToUpload.length > 0) {
const { staticDir } = collectionConfig.upload;

const staticPath = path.resolve(config.paths.configDir, staticDir);
Expand Down

0 comments on commit 4d578f1

Please sign in to comment.