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({
51
51
return semver . valid ( version )
52
52
}
53
53
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 {
59
63
const patchesDirectory = join ( appPath , patchDir )
60
64
const files = findPatchFiles ( patchesDirectory )
61
65
Original file line number Diff line number Diff line change @@ -35,10 +35,6 @@ if (argv.version || argv.v) {
35
35
} else if ( argv . help || argv . h ) {
36
36
printHelp ( )
37
37
} else {
38
- const packageManager = detectPackageManager (
39
- appPath ,
40
- argv [ "use-yarn" ] ? "yarn" : null ,
41
- )
42
38
const patchDir = slash ( normalize ( ( argv [ "patch-dir" ] || "patches" ) + sep ) )
43
39
if ( patchDir . startsWith ( "/" ) ) {
44
40
throw new Error ( "--patch-dir must be a relative path" )
@@ -56,7 +52,10 @@ if (argv.version || argv.v) {
56
52
/ p a c k a g e \. j s o n $ / ,
57
53
argv [ "case-sensitive-path-filtering" ] ,
58
54
)
59
-
55
+ const packageManager = detectPackageManager (
56
+ appPath ,
57
+ argv [ "use-yarn" ] ? "yarn" : null ,
58
+ )
60
59
packageNames . forEach ( ( packagePathSpecifier : string ) => {
61
60
makePatch ( {
62
61
packagePathSpecifier,
@@ -70,7 +69,7 @@ if (argv.version || argv.v) {
70
69
} else {
71
70
console . log ( "Applying patches..." )
72
71
const reverse = ! ! argv [ "reverse" ]
73
- applyPatchesForApp ( appPath , reverse , patchDir )
72
+ applyPatchesForApp ( { appPath, reverse, patchDir } )
74
73
}
75
74
}
76
75
You can’t perform that action at this time.
0 commit comments