feat: 新增包文件
This commit is contained in:
1 parent
7b65193e5c
commit
7ada85f175
104 files changed
+11273
-1
No files matched your search
@@ -0,0 +1,21 @@
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
|
||||
function cleanDirectory(dirPath) {
|
||||
const resolvedPath = path.resolve(dirPath)
|
||||
|
||||
const parentDir = path.basename(path.dirname(resolvedPath))
|
||||
if (parentDir !== 'packages') {
|
||||
console.error(`Error: Directory "${resolvedPath}" is not inside a "packages" folder`)
|
||||
return
|
||||
}
|
||||
|
||||
const distPath = path.join(resolvedPath, 'dist')
|
||||
|
||||
if (fs.existsSync(distPath)) {
|
||||
fs.rmSync(distPath, { recursive: true, force: true })
|
||||
console.log(`deleted: ${distPath}`)
|
||||
}
|
||||
}
|
||||
|
||||
cleanDirectory(process.cwd())
|
||||
Reference in new issue
Block a user