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

Refactor rollout configuration handling in bindVersionToPackages; replace rollout logic with direct package binding and update API call to use POST method.

This commit is contained in:
sunnylqm
2025-11-04 21:52:25 +08:00
parent 6751daf8e0
commit 818907f811
2 changed files with 4 additions and 13 deletions

View File

@@ -1,6 +1,6 @@
{ {
"name": "react-native-update-cli", "name": "react-native-update-cli",
"version": "2.3.2", "version": "2.4.0",
"description": "command line tool for react-native-update (remote updates for react native)", "description": "command line tool for react-native-update (remote updates for react native)",
"main": "index.js", "main": "index.js",
"bin": { "bin": {

View File

@@ -122,17 +122,6 @@ export const bindVersionToPackages = async ({
console.log(chalk.yellow(t('dryRun'))); console.log(chalk.yellow(t('dryRun')));
} }
if (rollout !== undefined) { if (rollout !== undefined) {
const rolloutConfig: Record<string, number> = {};
for (const pkg of pkgs) {
rolloutConfig[pkg.name] = rollout;
}
if (!dryRun) {
await put(`/app/${appId}/version/${versionId}`, {
config: {
rollout: rolloutConfig,
},
});
}
console.log( console.log(
`${t('rolloutConfigSet', { `${t('rolloutConfigSet', {
versions: pkgs.map((pkg: Package) => pkg.name).join(', '), versions: pkgs.map((pkg: Package) => pkg.name).join(', '),
@@ -142,8 +131,10 @@ export const bindVersionToPackages = async ({
} }
for (const pkg of pkgs) { for (const pkg of pkgs) {
if (!dryRun) { if (!dryRun) {
await put(`/app/${appId}/package/${pkg.id}`, { await post(`/app/${appId}/binding`, {
versionId, versionId,
rollout,
packageId: pkg.id,
}); });
} }
console.log( console.log(