Skip to content

Commit f2e47cc

Browse files
authored
Copy JSI headers unconditionally (#142)
1 parent 6d6fa0d commit f2e47cc

File tree

1 file changed

+18
-19
lines changed

1 file changed

+18
-19
lines changed

packages/host/src/node/cli/hermes.ts

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { spawn, SpawnFailure } from "bufout";
77
import { oraPromise } from "ora";
88
import { packageDirectorySync } from "pkg-dir";
99

10-
import { getLatestMtime, prettyPath } from "../path-utils";
10+
import { prettyPath } from "../path-utils";
1111

1212
const HOST_PACKAGE_ROOT = path.resolve(__dirname, "../../..");
1313
// FIXME: make this configurable with reasonable fallback before public release
@@ -77,24 +77,23 @@ export const command = new Command("vendor-hermes")
7777
"ReactCommon/jsi/jsi/"
7878
);
7979

80-
if (
81-
fs.existsSync(reactNativeJsiPath) &&
82-
(force ||
83-
getLatestMtime(hermesJsiPath) > getLatestMtime(reactNativeJsiPath))
84-
) {
85-
await oraPromise(
86-
fs.promises.cp(hermesJsiPath, reactNativeJsiPath, {
87-
recursive: true,
88-
}),
89-
{
90-
text: `Copying JSI from Hermes to React Native`,
91-
successText: "Copied JSI from Hermes to React Native",
92-
failText: (err) =>
93-
`Failed to copy JSI from Hermes to React Native: ${err.message}`,
94-
isEnabled: !silent,
95-
}
96-
);
97-
}
80+
assert(
81+
fs.existsSync(hermesJsiPath),
82+
`Hermes JSI path does not exist: ${hermesJsiPath}`
83+
);
84+
85+
await oraPromise(
86+
fs.promises.cp(hermesJsiPath, reactNativeJsiPath, {
87+
recursive: true,
88+
}),
89+
{
90+
text: `Copying JSI from patched Hermes to React Native`,
91+
successText: "Copied JSI from patched Hermes to React Native",
92+
failText: (err) =>
93+
`Failed to copy JSI from Hermes to React Native: ${err.message}`,
94+
isEnabled: !silent,
95+
}
96+
);
9897
console.log(hermesPath);
9998
} catch (error) {
10099
if (error instanceof SpawnFailure) {

0 commit comments

Comments
 (0)