ionic-team / ionic-team/ionic-cli

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

未關閉
#3,598 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
bug cordova
主要語言
TypeScript
星號
2k
分支
682
PR 合併指標
30 天內沒有已合併 PR

描述

**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 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
```

貢獻指南

開啟貢獻指南

研究方向

Start with the ionic cordova prepare, run, and platform add command paths described in the report, then trace how --nosave is passed when prepare or run installs a missing platform. Reproduce with the provided fresh-project command and verify that the prompted cordova platform add uses --nosave rather than --save for both commands.

由索引模型根據 Issue 內容生成。

評估

技術堆疊
typescript
領域
cli
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
描述清楚
新手友好度
48/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。