/
githubmirror
/
next.js
Обзор
Документация
Войти
/
githubmirror
/
next.js
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v16.2.12
scripts/rm.mjs
13 строк
365 B
Steven
chore: cross-platform `rm -rf` script (#49529)
10 май 2023, 04:14
Не верифицирован
10 май 2023, 04:14
11a7117
Код
Авторство
О чём код?
// @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 }) }