@ruan-cat/vercel-deploy-tool 0.8.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/config.ts +12 -8
package/package.json
CHANGED
package/src/config.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { resolve } from "pathe";
|
|
|
2
2
|
import { loadConfig } from "c12";
|
|
3
3
|
import { config as dotenvConfig } from "@dotenvx/dotenvx";
|
|
4
4
|
import { consola } from "consola";
|
|
5
|
-
import { merge } from "lodash-es";
|
|
5
|
+
import { merge, isEmpty } from "lodash-es";
|
|
6
6
|
import { program } from "commander";
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -226,17 +226,21 @@ export async function initVercelConfig() {
|
|
|
226
226
|
const vercelProjectId = currentDotenvConfig!.VERCEL_PROJECT_ID ?? process.env.VERCEL_PROJECT_ID;
|
|
227
227
|
const vercelToken = currentDotenvConfig!.VERCEL_TOKEN ?? process.env.VERCEL_TOKEN;
|
|
228
228
|
|
|
229
|
-
|
|
230
|
-
vercelOrgId
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
229
|
+
if (!isEmpty(vercelOrgId)) {
|
|
230
|
+
userConfig.vercelOrgId = vercelOrgId;
|
|
231
|
+
}
|
|
232
|
+
if (!isEmpty(vercelProjectId)) {
|
|
233
|
+
userConfig.vercelProjectId = vercelProjectId;
|
|
234
|
+
}
|
|
235
|
+
if (!isEmpty(vercelToken)) {
|
|
236
|
+
userConfig.vercelToken = vercelToken;
|
|
237
|
+
}
|
|
234
238
|
|
|
235
239
|
consola.success(" 完成初始化项目配置 ");
|
|
236
240
|
// 显示效果没有那么好看
|
|
237
|
-
consola.box(
|
|
241
|
+
consola.box(userConfig);
|
|
238
242
|
|
|
239
|
-
return
|
|
243
|
+
return userConfig;
|
|
240
244
|
}
|
|
241
245
|
|
|
242
246
|
/** 项目内的vercel配置 */
|