Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,22 @@
const combine = require('./combine-js-to-schema');
const fs = require('fs');
const glob = require('glob');
const path = require('path');
const {parseArgs, filterJSFile} = require('./combine-utils');

const {platform, outfile, fileList} = parseArgs(process.argv);

const allFiles = [];
fileList.forEach(file => {
if (fs.lstatSync(file).isDirectory()) {
const filePattern = path.sep === '\\' ? file.replace(/\\/g, '/') : file;
const dirFiles = glob
.sync(`${file}/**/*.{js,ts,tsx}`, {
.sync(`${filePattern}/**/*.{js,ts,tsx}`, {
nodir: true,
// TODO: This will remove the need of slash substitution above for Windows,
// but it requires glob@v9+; with the package currenlty relying on
// [email protected]; and flow-typed repo not having definitions for glob@9+.
// windowsPathsNoEscape: true,
})
.filter(element => filterJSFile(element, platform));
allFiles.push(...dirFiles);
Expand Down