Remove cpy-cli and rimraf dependencies; replace with simple script helper.

This commit is contained in:
David Anson 2021-11-11 22:02:51 -08:00
parent 090bbaa30f
commit 983e586c9c
3 changed files with 24 additions and 5 deletions

21
scripts/index.js Normal file
View file

@ -0,0 +1,21 @@
// @ts-check
"use strict";
const fs = require("fs");
const globby = require("globby");
const [ command, ...args ] = process.argv.slice(2);
if (command === "copy") {
const [ src, dest ] = args;
fs.copyFileSync(src, dest);
} else if (command === "delete") {
for (const arg of args) {
for (const file of globby.sync(arg)) {
fs.unlinkSync(file);
}
}
} else {
throw new Error(`Unsupported command: ${command}`);
}