mirror of
https://github.com/SECTL/SecScore.git
synced 2026-07-19 19:04:23 +08:00
b5874980fc
- 新增主题编辑器组件和上下文管理 - 实现主题的保存、删除和自定义功能 - 更新主题相关API接口 - 调整主题样式透明度 - 替换应用logo为高清版本 - 更新README和package.json描述信息
22 lines
580 B
JavaScript
22 lines
580 B
JavaScript
import fs from 'fs'
|
|
import path from 'path'
|
|
|
|
const root = process.cwd()
|
|
const targets = ['db.sqlite']
|
|
|
|
for (const name of targets) {
|
|
const filePath = path.join(root, name)
|
|
try {
|
|
if (fs.existsSync(filePath)) {
|
|
fs.rmSync(filePath, { force: true })
|
|
console.log(`[clean-db] removed ${filePath}`)
|
|
}
|
|
} catch (e) {
|
|
if (e.code === 'EPERM' || e.code === 'EACCES') {
|
|
console.warn(`[clean-db] skipped ${filePath}: file in use or permission denied`)
|
|
} else {
|
|
console.error(`[clean-db] failed to remove ${filePath}:`, e?.message || e)
|
|
}
|
|
}
|
|
}
|