添加本地部署

This commit is contained in:
test
2025-10-14 19:57:50 +08:00
parent 26e2cda793
commit 979a96e812
21 changed files with 607 additions and 11282 deletions

View File

@@ -1,4 +1,4 @@
import fs from "fs"
import fs from "node:fs"
function createFile(filePath) {
if (!fs.existsSync(filePath)) {
writeFile(filePath, "")
@@ -29,4 +29,16 @@ function appendFileSync(filePath, content) {
})
}
export { createFile, writeFile, appendFile, appendFileSync }
function readFileSync(filePath) {
return fs.readFileSync(filePath)
}
function renameFileSync(oldFilePath, newFilePath) {
fs.renameSync(oldFilePath, newFilePath, err => {
if (err) {
throw new Error(`文件重命名失败${oldFilePath} -> ${newFilePath}`)
}
})
}
export { createFile, writeFile, appendFile, appendFileSync, readFileSync, renameFileSync }