Skip to content

Commit

Permalink
Update dependencies and always return a promise
Browse files Browse the repository at this point in the history
  • Loading branch information
tschaub committed Jan 20, 2023
1 parent fc04b25 commit e1374b3
Show file tree
Hide file tree
Showing 5 changed files with 615 additions and 408 deletions.
9 changes: 5 additions & 4 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ exports.defaults = {
/**
* Push a git branch to a remote (pushes gh-pages by default).
* @param {string} basePath The base path.
* @param {Object} config Publish options.
* @param {object} config Publish options.
* @param {Function} callback Callback.
* @return {Promise} A promise.
*/
Expand Down Expand Up @@ -88,12 +88,13 @@ exports.publish = function publish(basePath, config, callback) {

try {
if (!fs.statSync(basePath).isDirectory()) {
done(new Error('The "base" option must be an existing directory'));
return;
const err = new Error('The "base" option must be an existing directory');
done(err);
return Promise.reject(err);
}
} catch (err) {
done(err);
return;
return Promise.reject(err);
}

const files = globby
Expand Down
2 changes: 1 addition & 1 deletion lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ exports.dirsToCreate = dirsToCreate;

/**
* Copy a file.
* @param {Object} obj Object with src and dest properties.
* @param {object} obj Object with src and dest properties.
* @param {function(Error)} callback Callback
*/
function copyFile(obj, callback) {
Expand Down
Loading

0 comments on commit e1374b3

Please sign in to comment.