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:
Create a fresh project, npx ionic@4 start nosave-ignored blank --cordova
cd nosave-ignored
Run npx ionic@4 cordova prepare ios@4.5.0 --nosave
Answer "Yes" when prompted to install the platform.
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 --nosavedoes 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
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.
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 theplatform add
command even if you specified--nosave
with those commands.Steps to Reproduce:
npx ionic@4 start nosave-ignored blank --cordova
cd nosave-ignored
npx ionic@4 cordova prepare ios@4.5.0 --nosave
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:
My
ionic info
: