Skip to content

Commit

Permalink
refactor: rename fail argument to failIfEmpty
Browse files Browse the repository at this point in the history
  • Loading branch information
JanMalch committed Oct 27, 2020
1 parent 88f6465 commit 12b1d2f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ const errorHandler = (e) => {
try {
globZip({
...program,
failIfEmpty: program.fail,
outFile: output,
globPatterns,
fileInfoCallback: process.env.VERBOSE ? prettyPrintSrcDest : undefined,
Expand Down
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export interface GlobZipOptions {
/**
* If set to `true`, the function will fail, if the resulting zip would be empty.
*/
fail?: boolean;
failIfEmpty?: boolean;
/**
* If set to `true`, empty directories will be included in the zip.
*/
Expand Down
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports.globZip = function (
outFile,
globPatterns: _globPatterns,
append,
fail: failIfZipEmpty,
failIfEmpty,
empty: includeEmptyDirectories,
wrap,
dryRun,
Expand Down Expand Up @@ -73,7 +73,7 @@ module.exports.globZip = function (
}
});

if (failIfZipEmpty && zip.getEntries().length === 0) {
if (failIfEmpty && zip.getEntries().length === 0) {
callback(new Error('no files found'));
return;
}
Expand Down

0 comments on commit 12b1d2f

Please sign in to comment.