mirror of
https://gitcode.com/github-mirrors/react-native-update-cli.git
synced 2025-09-16 09:41:38 +08:00
add updateVersionInfo
This commit is contained in:
23
cli.json
23
cli.json
@@ -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."
|
||||||
},
|
},
|
||||||
|
@@ -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('操作成功');
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user