mirror of
https://github.com/beilunyang/moemail.git
synced 2026-09-05 23:36:37 +08:00
fix: Update deploy script for support custom project name
This commit is contained in:
+17
-3
@@ -51,9 +51,23 @@ const setupConfigFile = (examplePath: string, targetPath: string) => {
|
|||||||
const configContent = readFileSync(examplePath, "utf-8");
|
const configContent = readFileSync(examplePath, "utf-8");
|
||||||
const json = JSON.parse(configContent);
|
const json = JSON.parse(configContent);
|
||||||
|
|
||||||
// 写入 pages 项目名称
|
// 处理自定义项目名称
|
||||||
if (targetPath.split("/").at(-1) === "wrangler.json") {
|
if (PROJECT_NAME !== "moemail") {
|
||||||
json.name = PROJECT_NAME;
|
const wranglerFileName = targetPath.split("/").at(-1);
|
||||||
|
|
||||||
|
switch (wranglerFileName) {
|
||||||
|
case "wrangler.json":
|
||||||
|
json.name = PROJECT_NAME;
|
||||||
|
break;
|
||||||
|
case "wrangler.email.json":
|
||||||
|
json.name = `${PROJECT_NAME}-email-receiver-worker`;
|
||||||
|
break;
|
||||||
|
case "wrangler.cleanup.json":
|
||||||
|
json.name = `${PROJECT_NAME}-cleanup-worker`;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理数据库配置
|
// 处理数据库配置
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"$schema": "node_modules/wrangler/config-schema.json",
|
"$schema": "node_modules/wrangler/config-schema.json",
|
||||||
"name": "${PROJECT_NAME}",
|
"name": "moemail",
|
||||||
"compatibility_date": "2024-03-20",
|
"compatibility_date": "2024-03-20",
|
||||||
"compatibility_flags": ["nodejs_compat"],
|
"compatibility_flags": ["nodejs_compat"],
|
||||||
"pages_build_output_dir": ".vercel/output/static",
|
"pages_build_output_dir": ".vercel/output/static",
|
||||||
|
|||||||
Reference in New Issue
Block a user