File size: 365 Bytes
1e92f2d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
// @ts-check
import { rm } from 'fs/promises'
import { join } from 'path'
const args = process.argv.slice(2)
if (args.length === 0) {
throw new Error('rm.mjs: requires a least one parameter')
}
for (const arg of args) {
const path = join(process.cwd(), arg)
console.log(`rm.mjs: deleting path "${path}"`)
await rm(path, { recursive: true, force: true })
}
|