Skip to content

Commit

Permalink
feature(putout) enable process of dot files
Browse files Browse the repository at this point in the history
  • Loading branch information
coderaiser committed Jun 22, 2020
1 parent 1275b2e commit 9393cc3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
8 changes: 7 additions & 1 deletion packages/putout/lib/cli/get-files.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,17 @@ async function getFiles(args) {
return rmDuplicates(mergeArrays(mergedFiles));
}

const globOptions = {
unique: true,
dot: true,
};

async function addExt(a) {
const [[e], files] = await Promise.all([
tryToCatch(lstat, a),
fastGlob(a, {
onlyFiles: false,
...globOptions,
}),
]);

Expand All @@ -39,7 +45,7 @@ async function addExt(a) {
const info = await lstat(file);

if (info.isDirectory()) {
promises.push(fastGlob(getJSGlob(file)));
promises.push(fastGlob(getJSGlob(file), globOptions));
continue;
}

Expand Down
5 changes: 4 additions & 1 deletion packages/putout/lib/cli/get-files.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,10 @@ test('putout: getFiles: getJSGlob: result', async (t) => {
fs.lstat = lstat;
stopAll();

t.ok(fastGlob.calledWith('get-files/some-glob'));
t.ok(fastGlob.calledWith('get-files/some-glob', {
unique: true,
dot: true,
}));
t.end();
});

0 comments on commit 9393cc3

Please sign in to comment.