1
0
mirror of https://gitcode.com/github-mirrors/react-native-update-cli.git synced 2025-09-16 09:41:38 +08:00
Code Issues Packages Projects Releases Wiki Activity GitHub Gitee

Add packageVersion

This commit is contained in:
sunnylqm
2021-10-18 17:53:29 +08:00
parent d6632ffcc6
commit 768484d7b5
4 changed files with 3057 additions and 2898 deletions

View File

@@ -80,6 +80,10 @@
},
"packageId": {
"hasValue": true
},
"packageVersion": {
"hasValue": true
}
}
},

3035
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -124,7 +124,24 @@ export const commands = {
);
const { appId } = await getSelectedApp(platform);
const versionId = options.versionId || (await chooseVersion(appId)).id;
const pkgId = options.packageId || (await choosePackage(appId)).id;
let pkgId = options.packageId;
if (!pkgId) {
let pkgVersion = options.packageVersion;
if (pkgVersion) {
pkgVersion = pkgVersion.trim();
const { data } = await get(`/app/${appId}/package/list?limit=1000`);
const pkg = data.find((d) => d.name === pkgVersion);
if (pkg) {
pkgId = pkg.id;
} else {
throw new Error(`未查询到匹配原生版本:${pkgVersion}`);
}
}
}
if (!pkgId) {
throw new Error('请提供 packageId 或 packageVersion 参数');
}
await put(`/app/${appId}/package/${pkgId}`, {
versionId,
});

2897
yarn.lock

File diff suppressed because it is too large Load Diff