UNPKG

hudada-cli

Version:

专为程序员准备的本地文档搜索,快捷开发工具

3 lines (2 loc) 451 B
#!/usr/bin/env node import{promises as o}from"fs";import r from"path";import{rimraf as t}from"rimraf";async function a(a,i){const n=[];return await async function a(c){try{const s=await o.readdir(c,{withFileTypes:!0});for(const o of s){const s=r.join(c,o.name);o.isDirectory()&&(o.name===i?(console.log(`正在删除: ${s}`),await t(s),n.push(s)):await a(s))}}catch(o){console.error(`扫描路径出错 ${c}:`,o)}}(a),n}export{a as cleanNodeModules};