File tree 3 files changed +26
-2
lines changed
3 files changed +26
-2
lines changed Original file line number Diff line number Diff line change 64
64
"typescript" : " ^3.2.2"
65
65
},
66
66
"dependencies" : {
67
+ "@types/is-ci" : " ^1.1.0" ,
67
68
"chalk" : " ^1.1.3" ,
68
69
"cross-spawn" : " ^5.1.0" ,
69
70
"fs-extra" : " ^4.0.1" ,
71
+ "is-ci" : " ^2.0.0" ,
70
72
"klaw-sync" : " ^4.0.0" ,
71
73
"minimist" : " ^1.2.0" ,
72
74
"rimraf" : " ^2.6.2" ,
Original file line number Diff line number Diff line change @@ -7,6 +7,11 @@ import { posix } from "path"
7
7
import { getPackageDetailsFromPatchFilename } from "./PackageDetails"
8
8
import { parsePatchFile } from "./patch/parse"
9
9
import { reversePatch } from "./patch/reverse"
10
+ import isCi from "is-ci"
11
+
12
+ // don't want to exit(1) on postinsall locally.
13
+ // see https://github.com/ds300/patch-package/issues/86
14
+ const shouldExitPostinstallWithError = isCi || process . env . NODE_ENV === "test"
10
15
11
16
function findPatchFiles ( patchesDirectory : string ) : string [ ] {
12
17
if ( ! existsSync ( patchesDirectory ) ) {
@@ -49,7 +54,7 @@ export const applyPatchesForApp = (
49
54
50
55
if ( files . length === 0 ) {
51
56
console . error ( red ( "No patch files found" ) )
52
- process . exit ( 1 )
57
+ process . exit ( shouldExitPostinstallWithError ? 1 : 0 )
53
58
}
54
59
55
60
files . forEach ( filename => {
@@ -106,7 +111,7 @@ export const applyPatchesForApp = (
106
111
pathSpecifier,
107
112
} )
108
113
}
109
- process . exit ( 1 )
114
+ process . exit ( shouldExitPostinstallWithError ? 1 : 0 )
110
115
}
111
116
} )
112
117
}
Original file line number Diff line number Diff line change 32
32
dependencies :
33
33
" @types/node" " *"
34
34
35
+ " @types/is-ci@^1.1.0 " :
36
+ version "1.1.0"
37
+ resolved "https://registry.yarnpkg.com/@types/is-ci/-/is-ci-1.1.0.tgz#583c5fbfcc461be9971106b9558930d67df49227"
38
+ integrity sha512-NbyqP5D4hwl5UWnnW4Cz0gIRjhecgx/9OApcCIpp4+tjqjROGf/NBcKKDfbI3YFBTTkD3JBshiNSv5V7VoVJJg==
39
+
35
40
" @types/jest@^23.3.12 " :
36
41
version "23.3.12"
37
42
resolved "https://registry.yarnpkg.com/@types/jest/-/jest-23.3.12.tgz#7e0ced251fa94c3bc2d1023d4b84b2992fa06376"
@@ -707,6 +712,11 @@ ci-info@^1.0.0:
707
712
version "1.0.0"
708
713
resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-1.0.0.tgz#dc5285f2b4e251821683681c381c3388f46ec534"
709
714
715
+ ci-info@^2.0.0 :
716
+ version "2.0.0"
717
+ resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46"
718
+ integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==
719
+
710
720
class-utils@^0.3.5 :
711
721
version "0.3.6"
712
722
resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463"
@@ -1846,6 +1856,13 @@ is-ci@^1.0.10, is-ci@^1.0.9:
1846
1856
dependencies :
1847
1857
ci-info "^1.0.0"
1848
1858
1859
+ is-ci@^2.0.0 :
1860
+ version "2.0.0"
1861
+ resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c"
1862
+ integrity sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==
1863
+ dependencies :
1864
+ ci-info "^2.0.0"
1865
+
1849
1866
is-data-descriptor@^0.1.4 :
1850
1867
version "0.1.4"
1851
1868
resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56"
You can’t perform that action at this time.
0 commit comments