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 updateVersionInfo

This commit is contained in:
sunnylqm
2022-06-29 09:20:57 +08:00
parent dae3e4024f
commit 07ee28ba3b
2 changed files with 37 additions and 0 deletions

View File

@@ -88,6 +88,29 @@
} }
}, },
"updateVersionInfo": {
"options": {
"platform": {
"hasValue": true
},
"versionId": {
"hasValue": true
},
"name": {
"default": false,
"hasValue": true
},
"description": {
"default": false,
"hasValue": true
},
"metaInfo": {
"default": false,
"hasValue": true
}
}
},
"build": { "build": {
"description": "Bundle javascript and copy assets." "description": "Bundle javascript and copy assets."
}, },

View File

@@ -149,4 +149,18 @@ export const commands = {
}); });
console.log('操作成功'); console.log('操作成功');
}, },
updateVersionInfo: async function ({ args, options }) {
const platform = checkPlatform(
options.platform || (await question('平台(ios/android):')),
);
const { appId } = await getSelectedApp(platform);
const versionId = options.versionId || (await chooseVersion(appId)).id;
const updateParams = {};
options.name && (updateParams.name = options.name);
options.description && (updateParams.description = options.description);
options.metaInfo && (updateParams.metaInfo = options.metaInfo);
await put(`/app/${appId}/version/${versionId}`, updateParams);
console.log('操作成功');
},
}; };