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: rndir path

This commit is contained in:
sunnylqm
2024-01-30 17:50:09 +08:00
parent eed19992d8
commit 6a0d82c7a5

View File

@@ -173,12 +173,12 @@ async function compileHermesByteCode(
) {
console.log(`Hermes enabled, now compiling to hermes bytecode:\n`);
// >= rn 0.69
let hermesCommand = require.resolve(
`react-native/sdks/hermesc/${getHermesOSBin()}/hermesc`,
{
paths: [process.cwd()],
},
const rnDir = path.dirname(require.resolve('react-native'));
const hermesCommand = path.join(
rnDir,
`/sdks/hermesc/${getHermesOSBin()}/hermesc`,
);
// < rn 0.69
if (!fs.existsSync(hermesCommand)) {
const hermesPackage = fs.existsSync('node_modules/hermes-engine')