fea: 检查本地环境
This commit is contained in:
1 parent
b34def5f32
commit
3a81a927e4
3 files changed
+25
No files matched your search
@@ -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)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user