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

fix: hermes path

This commit is contained in:
sunnylqm
2024-03-05 23:29:05 +08:00
parent 0d03e18c58
commit 070991d08b

View File

@@ -196,22 +196,15 @@ async function compileHermesByteCode(
paths: [process.cwd()], paths: [process.cwd()],
}), }),
); );
let hermesCommand = path.join( let hermesPath = path.join(rnDir, `/sdks/hermesc/${getHermesOSBin()}`);
rnDir,
`/sdks/hermesc/${getHermesOSBin()}/hermesc`,
);
// < rn 0.69 // < rn 0.69
if (!fs.existsSync(hermesCommand)) { if (!fs.existsSync(hermesPath)) {
const hermesPackage = fs.existsSync('node_modules/hermes-engine') hermesPath = `node_modules/hermes-engine/${getHermesOSBin()}`;
? 'node_modules/hermes-engine' // 0.2+
: 'node_modules/hermesvm'; // < 0.2
const hermesPath = `${hermesPackage}/${getHermesOSBin()}`;
hermesCommand = fs.existsSync(`${hermesPath}/hermesc`)
? `${hermesPath}/hermesc` // 0.5+
: `${hermesPath}/hermes`; // < 0.5
} }
const hermesCommand = `${hermesPath}/hermesc`;
const args = [ const args = [
'-emit-binary', '-emit-binary',
'-out', '-out',