File tree Expand file tree Collapse file tree 2 files changed +14
-11
lines changed Expand file tree Collapse file tree 2 files changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -51,11 +51,15 @@ function getInstalledPackageVersion({
5151 return semver . valid ( version )
5252}
5353
54- export function applyPatchesForApp (
55- appPath : string ,
56- reverse : boolean ,
57- patchDir : string ,
58- ) : void {
54+ export function applyPatchesForApp ( {
55+ appPath,
56+ reverse,
57+ patchDir,
58+ } : {
59+ appPath : string
60+ reverse : boolean
61+ patchDir : string
62+ } ) : void {
5963 const patchesDirectory = join ( appPath , patchDir )
6064 const files = findPatchFiles ( patchesDirectory )
6165
Original file line number Diff line number Diff line change @@ -35,10 +35,6 @@ if (argv.version || argv.v) {
3535} else if ( argv . help || argv . h ) {
3636 printHelp ( )
3737} else {
38- const packageManager = detectPackageManager (
39- appPath ,
40- argv [ "use-yarn" ] ? "yarn" : null ,
41- )
4238 const patchDir = slash ( normalize ( ( argv [ "patch-dir" ] || "patches" ) + sep ) )
4339 if ( patchDir . startsWith ( "/" ) ) {
4440 throw new Error ( "--patch-dir must be a relative path" )
@@ -56,7 +52,10 @@ if (argv.version || argv.v) {
5652 / p a c k a g e \. j s o n $ / ,
5753 argv [ "case-sensitive-path-filtering" ] ,
5854 )
59-
55+ const packageManager = detectPackageManager (
56+ appPath ,
57+ argv [ "use-yarn" ] ? "yarn" : null ,
58+ )
6059 packageNames . forEach ( ( packagePathSpecifier : string ) => {
6160 makePatch ( {
6261 packagePathSpecifier,
@@ -70,7 +69,7 @@ if (argv.version || argv.v) {
7069 } else {
7170 console . log ( "Applying patches..." )
7271 const reverse = ! ! argv [ "reverse" ]
73- applyPatchesForApp ( appPath , reverse , patchDir )
72+ applyPatchesForApp ( { appPath, reverse, patchDir } )
7473 }
7574}
7675
You can’t perform that action at this time.
0 commit comments