ionic-team / ionic-cli

The Ionic command-line interface
MIT License
2k stars 654 forks source link

cordova --nosave is not propagated for commands running platform add #3598

Open ajcrites opened 6 years ago

ajcrites commented 6 years ago

Description: This is related to #2946

ionic cordova platform add $PLATFORM --nosave works as expected.

There are other commands that will prompt you to run cordova platform add or run it for you if it's necessary:

These do not propagate the --nosave flag to the platform add command even if you specified --nosave with those commands.

Steps to Reproduce:

  1. Create a fresh project, npx ionic@4 start nosave-ignored blank --cordova
  2. cd nosave-ignored
  3. Run npx ionic@4 cordova prepare ios@4.5.0 --nosave
  4. Answer "Yes" when prompted to install the platform.
  5. Notice that the command that is run is cordova platform add ios@4.5.0 --save.

Note that ionic cordova platform add ios@4.5.0 --nosave does respect the --nosave flag.

Output:

? Platform ios@4.5.0 is not installed! Would you like to install it? Yes
> cordova platform add ios@4.5.0 --save
Using cordova-fetch for cordova-ios@4.5.0

My ionic info:

Ionic:

   ionic (Ionic CLI)          : 4.1.2
   Ionic Framework            : @ionic/angular 4.0.0-beta.7
   @angular-devkit/core       : 0.7.5
   @angular-devkit/schematics : 0.7.5
   @angular/cli               : 6.1.5
   @ionic/ng-toolkit          : 1.0.8
   @ionic/schematics-angular  : 1.0.6

Cordova:

   cordova (Cordova CLI) : 8.0.0
   Cordova Platforms     : ios 4.5.0
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.2, cordova-plugin-ionic-webview 2.1.4, (and 4 other plugins)

System:

   Android SDK Tools : 26.1.1 (/Users/acrites/Library/Android/sdk)
   ios-deploy        : 2.0.0
   ios-sim           : 7.0.0
   NodeJS            : v8.11.4 (/Users/acrites/.n/bin/node)
   npm               : 5.6.0
   OS                : macOS High Sierra
   Xcode             : Xcode 9.4.1 Build version 9F2000
imhoffd commented 6 years ago

We'll likely need to fix this for any of the other commands which take a platform for an argument. They all prompt to install the platform if it's missing.