Skip to content

Commit

Permalink
add callback when existing files are skipped
Browse files Browse the repository at this point in the history
  • Loading branch information
benthemonkey committed May 18, 2021
1 parent 3e3edf5 commit 8ca0193
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,13 @@ Type: `function`
This function gets called with the S3 keyname as the first parameter if the uploaded file is a new file in the bucket, much like `onChange`.


##### onSkippedExisting

Type: `function`

This function gets called with the S3 keyname as the first parameter if the file was skipped because `uploadNewFilesOnly` is set to `true` and a different file with the same name exists on S3.


#### uploadNewFilesOnly

Type: `boolean`
Expand Down
4 changes: 4 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,10 @@ gulpPrefixer = function (AWS) {
} else {
fancyLog(colors.gray("Skipping Upload of Existing File ..... "), keyname);

if (options.onSkippedExisting && typeof options.onSkippedExisting === 'function') {
options.onSkippedExisting.call(this, keyname);
}

callback(null);
}

Expand Down
1 change: 1 addition & 0 deletions src/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ module.exports = {
'onChange',
'onNoChange',
'onNew',
'onSkippedExisting',
'uploadNewFilesOnly',
'verbose'
];
Expand Down

0 comments on commit 8ca0193

Please sign in to comment.