mirror of
https://gitcode.com/github-mirrors/react-native-update-cli.git
synced 2025-09-16 01:41:37 +08:00
fix gradle check
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "react-native-update-cli",
|
||||
"version": "1.30.4",
|
||||
"version": "1.31.0",
|
||||
"description": "Command tools for javaScript updater with `pushy` service for react native apps.",
|
||||
"main": "index.js",
|
||||
"bin": {
|
||||
|
@@ -33,7 +33,7 @@ async function runReactNativeBundleCommand(
|
||||
gradleConfig = await checkGradleConfig();
|
||||
if (gradleConfig.crunchPngs !== false) {
|
||||
console.warn(
|
||||
'android的crunchPngs选项似乎尚未禁用(如已禁用则请忽略此提示),这可能导致热更包体积异常增大,具体请参考 https://pushy.reactnative.cn/docs/getting-started.html#%E7%A6%81%E7%94%A8-android-%E7%9A%84-crunch-%E4%BC%98%E5%8C%96 \n',
|
||||
'android 的 crunchPngs 选项似乎尚未禁用(如已禁用则请忽略此提示),这可能导致热更包体积异常增大,具体请参考 https://pushy.reactnative.cn/docs/getting-started.html#%E7%A6%81%E7%94%A8-android-%E7%9A%84-crunch-%E4%BC%98%E5%8C%96 \n',
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -177,17 +177,19 @@ async function checkGradleConfig() {
|
||||
let crunchPngs;
|
||||
try {
|
||||
const gradleConfig = await g2js.parseFile('android/app/build.gradle');
|
||||
crunchPngs = gradleConfig.android.buildTypes.release.crunchPngs;
|
||||
const projectConfig = gradleConfig['project.ext.react'];
|
||||
for (const packagerConfig of projectConfig) {
|
||||
if (
|
||||
packagerConfig.includes('enableHermes') &&
|
||||
packagerConfig.includes('true')
|
||||
) {
|
||||
enableHermes = true;
|
||||
break;
|
||||
if (projectConfig) {
|
||||
for (const packagerConfig of projectConfig) {
|
||||
if (
|
||||
packagerConfig.includes('enableHermes') &&
|
||||
packagerConfig.includes('true')
|
||||
) {
|
||||
enableHermes = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
crunchPngs = gradleConfig.android.buildTypes.release.crunchPngs;
|
||||
} catch (e) {}
|
||||
return {
|
||||
enableHermes,
|
||||
@@ -609,7 +611,6 @@ export const commands = {
|
||||
const { version, major, minor } = getRNVersion();
|
||||
|
||||
console.log('Bundling with react-native: ', version);
|
||||
printVersionCommand();
|
||||
|
||||
await runReactNativeBundleCommand(
|
||||
bundleName,
|
||||
|
@@ -134,7 +134,9 @@ export const commands = {
|
||||
let minPkgVersion = options.minPackageVersion;
|
||||
let maxPkgVersion = options.maxPackageVersion;
|
||||
let rollout = options.rollout;
|
||||
if (rollout !== undefined) {
|
||||
if (rollout === undefined) {
|
||||
rollout = null;
|
||||
} else {
|
||||
try {
|
||||
rollout = parseInt(rollout);
|
||||
} catch (e) {
|
||||
|
Reference in New Issue
Block a user