mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-21 21:30:47 +02:00
Remove cpy-cli and rimraf dependencies; replace with simple script helper.
This commit is contained in:
parent
090bbaa30f
commit
983e586c9c
3 changed files with 24 additions and 5 deletions
21
scripts/index.js
Normal file
21
scripts/index.js
Normal 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}`);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue