chore: import upstream snapshot with attribution
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
//@ts-check
|
||||
const { mkdirSync, copySync } = require('fs-extra');
|
||||
const glob = require('tinyglobby');
|
||||
const { join, basename } = require('path');
|
||||
|
||||
const p = process.argv[2];
|
||||
|
||||
const args = process.argv.slice(2);
|
||||
const dest = args[args.length - 1];
|
||||
const from = args.slice(0, args.length - 1);
|
||||
|
||||
try {
|
||||
mkdirSync(dest, {
|
||||
recursive: true,
|
||||
});
|
||||
} catch {}
|
||||
for (const f of from) {
|
||||
const matchingFiles = glob.globSync(f, {
|
||||
cwd: process.cwd(),
|
||||
onlyDirectories: true,
|
||||
});
|
||||
|
||||
for (const file of matchingFiles) {
|
||||
const destFile = join(dest, basename(file));
|
||||
console.log(file, '=>', destFile);
|
||||
copySync(file, destFile);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user