qdmp-cli 0.1.9 → 0.1.10
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 +2 -2
- package/utils/common.js +10 -5
- package/.claude/settings.local.json +0 -8
package/package.json
CHANGED
package/utils/common.js
CHANGED
|
@@ -18,13 +18,18 @@ export const getUploadPath = (appId, code) => {
|
|
|
18
18
|
* @returns appId
|
|
19
19
|
*/
|
|
20
20
|
export function getAppId(env = "prod") {
|
|
21
|
+
const fieldName = env === "prod" ? "appId" : "devAppId";
|
|
21
22
|
try {
|
|
22
23
|
const qdmpJsonPath = `${process.cwd()}/qdmp.json`;
|
|
23
24
|
const data = fs.readFileSync(path.resolve(qdmpJsonPath), "utf8");
|
|
24
25
|
const qdmpJson = JSON.parse(data);
|
|
25
|
-
|
|
26
|
+
const appId = qdmpJson?.[fieldName] || "";
|
|
27
|
+
if (!appId) {
|
|
28
|
+
error(`未授权应用,请在根目录下qdmp.json配置对应的${fieldName}`);
|
|
29
|
+
}
|
|
30
|
+
return appId;
|
|
26
31
|
} catch (e) {
|
|
27
|
-
error(
|
|
32
|
+
error(`未授权应用,请在根目录下qdmp.json配置对应的${fieldName}`);
|
|
28
33
|
}
|
|
29
34
|
}
|
|
30
35
|
|
|
@@ -153,16 +158,16 @@ async function copyAndSetEmpDistFolder(appId, code) {
|
|
|
153
158
|
JSON.stringify({
|
|
154
159
|
appId,
|
|
155
160
|
version: code,
|
|
156
|
-
})
|
|
161
|
+
}),
|
|
157
162
|
);
|
|
158
163
|
} else {
|
|
159
164
|
const qdmpJson = JSON.parse(
|
|
160
|
-
fs.readFileSync(`${WORKSPACE_DIR}/dist/main/qdmp.json`, "utf8")
|
|
165
|
+
fs.readFileSync(`${WORKSPACE_DIR}/dist/main/qdmp.json`, "utf8"),
|
|
161
166
|
);
|
|
162
167
|
qdmpJson.version = code;
|
|
163
168
|
fs.writeFileSync(
|
|
164
169
|
`${WORKSPACE_DIR}/dist/main/qdmp.json`,
|
|
165
|
-
JSON.stringify(qdmpJson)
|
|
170
|
+
JSON.stringify(qdmpJson),
|
|
166
171
|
);
|
|
167
172
|
}
|
|
168
173
|
success("文件复制完成");
|