File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -242,8 +242,8 @@ export function applyPatch({
242242} : {
243243 patchFilePath : string
244244 reverse : boolean
245- packageDetails : PackageDetails
246- patchDir : string
245+ packageDetails ? : PackageDetails
246+ patchDir ? : string
247247} ) : boolean {
248248 const patch = readPatch ( { patchFilePath, packageDetails, patchDir } )
249249 try {
Original file line number Diff line number Diff line change @@ -11,12 +11,15 @@ export function readPatch({
1111 patchDir,
1212} : {
1313 patchFilePath : string
14- packageDetails : PackageDetails
15- patchDir : string
14+ packageDetails ? : PackageDetails
15+ patchDir ? : string
1616} ) : PatchFilePart [ ] {
1717 try {
1818 return parsePatchFile ( readFileSync ( patchFilePath ) . toString ( ) )
1919 } catch ( e ) {
20+ if ( packageDetails == null || patchDir == null ) {
21+ throw e
22+ }
2023 const fixupSteps : string [ ] = [ ]
2124 const relativePatchFilePath = normalize (
2225 relative ( process . cwd ( ) , patchFilePath ) ,
You can’t perform that action at this time.
0 commit comments