mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-22 05:40:48 +02:00
21 lines
437 B
JavaScript
21 lines
437 B
JavaScript
// @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}`);
|
|
}
|