@@ -7,7 +7,7 @@ import { spawn, SpawnFailure } from "bufout";
77import { oraPromise } from "ora" ;
88import { packageDirectorySync } from "pkg-dir" ;
99
10- import { getLatestMtime , prettyPath } from "../path-utils" ;
10+ import { prettyPath } from "../path-utils" ;
1111
1212const 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