This repository was archived by the owner on Apr 4, 2023. 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 @@ -36,17 +36,24 @@ function readConfig() {
3636}
3737
3838// workaround for https://github.com/NativeScript/nativescript-cli/issues/2521 (2.5.0 only)
39- var nativeScriptVersion = require ( 'child_process' ) . execSync ( 'nativescript --version' ) ;
40- var promptSupported = nativeScriptVersion . indexOf ( "2.5.0" ) === - 1 ;
39+ var nativeScriptVersion = "" ;
40+ try {
41+ nativeScriptVersion = __webpack_require__ ( /*! child_process */ 2 ) . execSync ( 'nativescript --version' ) ;
42+ } catch ( err ) {
43+ // On some environments nativescript is not in the PATH
44+ // Ignore the error
45+ }
46+
47+ var isNativeScriptCLI250 = nativeScriptVersion . indexOf ( "2.5.0" ) !== - 1 ;
4148
4249// note that for CI builds you want a pluginConfigFile, otherwise the build will fail
43- if ( process . argv . indexOf ( "config" ) == - 1 && fs . existsSync ( pluginConfigPath ) ) {
50+ if ( process . argv . indexOf ( "config" ) === - 1 && fs . existsSync ( pluginConfigPath ) ) {
4451 readConfig ( ) ;
4552 console . log ( "Config file exists (" + pluginConfigFile + ")" ) ;
4653 askiOSPromptResult ( config ) ;
4754 askAndroidPromptResult ( config ) ;
4855 promptQuestionsResult ( config ) ;
49- } else if ( ! promptSupported && process . argv . indexOf ( "setup" ) == - 1 ) {
56+ } else if ( isNativeScriptCLI250 && process . argv . indexOf ( "setup" ) = == - 1 ) {
5057 console . log ( "*******************************************************************" ) ;
5158 console . log ( "*******************************************************************" ) ;
5259 console . log ( "************************** IMPORTANT: *****************************" ) ;
You can’t perform that action at this time.
0 commit comments