mirror of
https://gitcode.com/github-mirrors/react-native-update-cli.git
synced 2025-09-16 09:41:38 +08:00
Add packageVersion
This commit is contained in:
4
cli.json
4
cli.json
@@ -80,6 +80,10 @@
|
||||
},
|
||||
"packageId": {
|
||||
"hasValue": true
|
||||
},
|
||||
|
||||
"packageVersion": {
|
||||
"hasValue": true
|
||||
}
|
||||
}
|
||||
},
|
||||
|
3035
pnpm-lock.yaml
generated
Normal file
3035
pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -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,
|
||||
});
|
||||
|
Reference in New Issue
Block a user