mirror of
https://gitcode.com/github-mirrors/react-native-update-cli.git
synced 2025-09-16 09:41:38 +08:00
Check does appId/appKey match
This commit is contained in:
@@ -52,8 +52,25 @@ export const commands = {
|
|||||||
if (!fn || !fn.endsWith('.ipa')) {
|
if (!fn || !fn.endsWith('.ipa')) {
|
||||||
throw new Error('Usage: pushy uploadIpa <ipaFile>');
|
throw new Error('Usage: pushy uploadIpa <ipaFile>');
|
||||||
}
|
}
|
||||||
const { versionName, buildTime } = await getIpaInfo(fn);
|
const {
|
||||||
const { appId } = await getSelectedApp('ios');
|
versionName,
|
||||||
|
buildTime,
|
||||||
|
appId: appIdInPkg,
|
||||||
|
appKey: appKeyInPkg,
|
||||||
|
} = await getIpaInfo(fn);
|
||||||
|
const { appId, appKey } = await getSelectedApp('ios');
|
||||||
|
|
||||||
|
if (appIdInPkg && appIdInPkg !== appId) {
|
||||||
|
throw new Error(
|
||||||
|
`appId不匹配!当前ipa:${appIdInPkg}, 当前update.json:${appId}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (appKeyInPkg && appKeyInPkg !== appKey) {
|
||||||
|
throw new Error(
|
||||||
|
`appKey不匹配!当前ipa:${appKeyInPkg}, 当前update.json:${appKey}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
const { hash } = await uploadFile(fn);
|
const { hash } = await uploadFile(fn);
|
||||||
|
|
||||||
@@ -70,8 +87,25 @@ export const commands = {
|
|||||||
if (!fn || !fn.endsWith('.apk')) {
|
if (!fn || !fn.endsWith('.apk')) {
|
||||||
throw new Error('Usage: pushy uploadApk <apkFile>');
|
throw new Error('Usage: pushy uploadApk <apkFile>');
|
||||||
}
|
}
|
||||||
const { versionName, buildTime } = await getApkInfo(fn);
|
const {
|
||||||
const { appId } = await getSelectedApp('android');
|
versionName,
|
||||||
|
buildTime,
|
||||||
|
appId: appIdInPkg,
|
||||||
|
appKey: appKeyInPkg,
|
||||||
|
} = await getApkInfo(fn);
|
||||||
|
const { appId, appKey } = await getSelectedApp('android');
|
||||||
|
|
||||||
|
if (appIdInPkg && appIdInPkg !== appId) {
|
||||||
|
throw new Error(
|
||||||
|
`appId不匹配!当前apk:${appIdInPkg}, 当前update.json:${appId}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (appKeyInPkg && appKeyInPkg !== appKey) {
|
||||||
|
throw new Error(
|
||||||
|
`appKey不匹配!当前apk:${appKeyInPkg}, 当前update.json:${appKey}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
const { hash } = await uploadFile(fn);
|
const { hash } = await uploadFile(fn);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user