This repository was archived by the owner on Aug 7, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -19,9 +19,16 @@ const escapeWithQuotes = arg => `"${arg}"`;
19
19
const isTnsCommand = flag => flag . endsWith ( "-app" ) ;
20
20
const isEnvCommand = flag => flag . indexOf ( "env." ) > - 1 ;
21
21
const shouldUglify = ( ) => process . env . npm_config_uglify ;
22
- const shouldSnapshot = platform => platform == "android" &&
23
- require ( "os" ) . type ( ) != "Windows_NT" &&
24
- process . env . npm_config_snapshot ;
22
+
23
+ const platformSupportsSnapshot = platform => platform === "android" ;
24
+ const osSupportsSnapshot = ( ) => require ( "os" ) . type ( ) != "Windows_NT" ;
25
+ const snapshotOption = env =>
26
+ process . env . npm_config_snapshot || ( env && env . includes ( "env.snapshot" ) ) ;
27
+
28
+ const shouldSnapshot = ( platform , env ) =>
29
+ platformSupportsSnapshot ( platform ) &&
30
+ osSupportsSnapshot ( ) &&
31
+ snapshotOption ( env ) ;
25
32
26
33
const npmArgs = JSON . parse ( process . env . npm_config_argv ) . original ;
27
34
const tnsArgs = getTnsArgs ( npmArgs ) ;
@@ -60,7 +67,7 @@ function execute(options) {
60
67
] ;
61
68
}
62
69
63
- if ( shouldSnapshot ( platform ) ) {
70
+ if ( shouldSnapshot ( platform , options . env ) ) {
64
71
commands . push ( ( ) => installSnapshotArtefacts ( ) ) ;
65
72
}
66
73
You can’t perform that action at this time.
0 commit comments