Skip to content

Commit f323e23

Browse files
authored
Merge pull request #452 from tschaub/updates
Assorted updates
2 parents ef1c90d + bdc342b commit f323e23

7 files changed

Lines changed: 634 additions & 413 deletions

File tree

.github/dependabot.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: 2
2+
3+
updates:
4+
- package-ecosystem: npm
5+
directory: "/"
6+
schedule:
7+
interval: weekly
8+
open-pull-requests-limit: 10
9+
versioning-strategy: increase-if-necessary
10+
11+
- package-ecosystem: github-actions
12+
directory: "/"
13+
schedule:
14+
interval: weekly

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ jobs:
2222
os:
2323
- ubuntu-latest
2424
node:
25-
- 12
2625
- 14
2726
- 16
27+
- 18
2828

2929
steps:
3030
- name: Clone repository

lib/index.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ exports.defaults = {
5353
/**
5454
* Push a git branch to a remote (pushes gh-pages by default).
5555
* @param {string} basePath The base path.
56-
* @param {Object} config Publish options.
56+
* @param {object} config Publish options.
5757
* @param {Function} callback Callback.
5858
* @return {Promise} A promise.
5959
*/
@@ -88,12 +88,13 @@ exports.publish = function publish(basePath, config, callback) {
8888

8989
try {
9090
if (!fs.statSync(basePath).isDirectory()) {
91-
done(new Error('The "base" option must be an existing directory'));
92-
return;
91+
const err = new Error('The "base" option must be an existing directory');
92+
done(err);
93+
return Promise.reject(err);
9394
}
9495
} catch (err) {
9596
done(err);
96-
return;
97+
return Promise.reject(err);
9798
}
9899

99100
const files = globby

lib/util.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@ const fs = require('fs-extra');
99
* @return {Array<string>} List of directory paths.
1010
*/
1111
function uniqueDirs(files) {
12-
const dirs = {};
12+
const dirs = new Set();
1313
files.forEach((filepath) => {
1414
const parts = path.dirname(filepath).split(path.sep);
1515
let partial = parts[0] || '/';
16-
dirs[partial] = true;
16+
dirs.add(partial);
1717
for (let i = 1, ii = parts.length; i < ii; ++i) {
1818
partial = path.join(partial, parts[i]);
19-
dirs[partial] = true;
19+
dirs.add(partial);
2020
}
2121
});
22-
return Object.keys(dirs);
22+
return Array.from(dirs);
2323
}
2424
exports.uniqueDirs = uniqueDirs;
2525

@@ -70,7 +70,7 @@ exports.dirsToCreate = dirsToCreate;
7070

7171
/**
7272
* Copy a file.
73-
* @param {Object} obj Object with src and dest properties.
73+
* @param {object} obj Object with src and dest properties.
7474
* @param {function(Error)} callback Callback
7575
*/
7676
function copyFile(obj, callback) {

0 commit comments

Comments
 (0)