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}"`;
1919const isTnsCommand = flag => flag . endsWith ( "-app" ) ;
2020const isEnvCommand = flag => flag . indexOf ( "env." ) > - 1 ;
2121const 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 ) ;
2532
2633const npmArgs = JSON . parse ( process . env . npm_config_argv ) . original ;
2734const tnsArgs = getTnsArgs ( npmArgs ) ;
@@ -60,7 +67,7 @@ function execute(options) {
6067 ] ;
6168 }
6269
63- if ( shouldSnapshot ( platform ) ) {
70+ if ( shouldSnapshot ( platform , options . env ) ) {
6471 commands . push ( ( ) => installSnapshotArtefacts ( ) ) ;
6572 }
6673
You can’t perform that action at this time.
0 commit comments