Skip to content

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

@ajcrites

Description

@ajcrites

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:

  • ionic cordova prepare $PLATFORM
  • ionic cordova run $PLATFORM

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 [email protected] --nosave
  4. Answer "Yes" when prompted to install the platform.
  5. Notice that the command that is run is cordova platform add [email protected] --save.

Note that ionic cordova platform add [email protected] --nosave does respect the --nosave flag.

Output:

? Platform [email protected] is not installed! Would you like to install it? Yes
> cordova platform add [email protected] --save
Using cordova-fetch for [email protected]

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcordovaIonic projects integrated with Cordova

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions