Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add callback when existing files are skipped #68

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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