Skip to content

Commit e9acdc0

Browse files
committed
New: Export more methods
1 parent 2c9dfb9 commit e9acdc0

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

index.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,22 @@ async function output(file) {
2929
await writeFile(file.path, file.contents);
3030
}
3131

32-
async function download(owner, repo, directory, options = {}) {
32+
async function fetchFiles(owner, repo, directory, options = {}) {
3333
var { tree } = await ghTree(owner, repo, { recursive: true, sha: options.sha });
3434

3535
var paths = tree
3636
.filter((node) => node.path.startsWith(directory) && node.type === 'blob')
3737
.map((node) => node.path);
3838

39-
var files = await getFiles(owner, repo, options.sha, paths);
39+
return getFiles(owner, repo, options.sha, paths);
40+
}
41+
42+
async function download(owner, repo, directory, options = {}) {
43+
var files = await fetchFiles(owner, repo, directory, options);
4044

4145
await Promise.all(files.map(output));
4246
}
4347

4448
module.exports = download;
49+
module.exports.fetchFiles = fetchFiles;
50+
module.exports.output = output;

0 commit comments

Comments
 (0)