@gmcb/cli 0.10.0 → 0.10.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/CHANGELOG.md +5 -0
- package/lib/scripts/publish.js +8 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
<!-- release:insert -->
|
|
4
4
|
|
|
5
|
+
## 0.10.1 [2026-11-22]
|
|
6
|
+
<!-- generated-by: specs -->
|
|
7
|
+
### 优化
|
|
8
|
+
- 发布上传的远端路径顺序调整为 `<appId>/<versionName>.<versionCode>/<平台>/<原文件名>`:平台目录移到版本目录之后;无平台目录的 apk/exe/zip 路径仍为 `<appId>/<versionName>.<versionCode>/<原文件名>`。
|
|
9
|
+
|
|
5
10
|
## 0.10.0 [2026-11-22]
|
|
6
11
|
<!-- generated-by: specs -->
|
|
7
12
|
### 优化
|
package/lib/scripts/publish.js
CHANGED
|
@@ -32,14 +32,19 @@ async function publish(options) {
|
|
|
32
32
|
const secretId = config_1.CONFIG_DATA.cos?.secretid || '';
|
|
33
33
|
const secretKey = config_1.CONFIG_DATA.cos?.secretkey || '';
|
|
34
34
|
const dir = options.dir || '';
|
|
35
|
-
const
|
|
35
|
+
const configPath = config_1.CONFIG_DATA.publish?.path || config_1.CONFIG_DATA.pub?.path || '';
|
|
36
|
+
const appPath = configPath || `/app/${appId}`;
|
|
37
|
+
// 接口 path 语义保持不变:默认带平台目录,配置路径时不追加
|
|
38
|
+
const platformPath = !configPath && dir ? `/${dir}` : '';
|
|
39
|
+
const remotePath = `${appPath}${platformPath}`;
|
|
36
40
|
const cos = new cos_nodejs_sdk_v5_1.default({
|
|
37
41
|
SecretId: secretId,
|
|
38
42
|
SecretKey: secretKey,
|
|
39
43
|
});
|
|
40
44
|
const remoteUrls = [];
|
|
41
|
-
//
|
|
45
|
+
// 对象路径:版本目录在前,平台目录在后
|
|
42
46
|
const versionDir = `${versionName}.${versionCode}`;
|
|
47
|
+
const versionPath = `${appPath}/${versionDir}${platformPath}`;
|
|
43
48
|
for (const file of options.files) {
|
|
44
49
|
const appCfg = PUBLISH_APP_CFG[file.ext];
|
|
45
50
|
const fileName = appCfg?.name || `${file.name}.${file.ext}`;
|
|
@@ -48,7 +53,7 @@ async function publish(options) {
|
|
|
48
53
|
if (!(0, fs_1.existsSync)(source)) {
|
|
49
54
|
utils_1.log.error(`未找到待上传文件:${source}`);
|
|
50
55
|
}
|
|
51
|
-
const path = `${
|
|
56
|
+
const path = `${versionPath}/${fileName}`;
|
|
52
57
|
const remoteUrl = `https://${bucket}.cos.${region}.myqcloud.com${`/${path}`.replace(/\/+/g, '/')}`;
|
|
53
58
|
await new Promise((res) => {
|
|
54
59
|
const spinner = (0, ora_1.default)(`资源正在上传...`).start();
|