fea: 检查本地环境

This commit is contained in:
cancerai committed 2026-10-11 22:41:04 +08:00
1 parent b34def5f32
commit 3a81a927e4
3 files changed
+25

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
import { responseStr } from "../const/response_str";
export function checkEnv() {
const adminName = Bun.env.admin_name
const adminPasswd = Bun.env.admin_passwd
let isRight = true
if (adminName == undefined) {
console.log(responseStr.ENV_ADMINNAME_INVALID);
isRight = false
}
if (adminPasswd == undefined) {
console.log(responseStr.ENV_ADMINPASSWD_INVALID);
isRight = false
}
if (!isRight) {
process.exit(1)
}
}