leoafarias/fvm

[Feature Request] Spawn on a flavor

Open

#575 geöffnet am 29. Nov. 2023

Auf GitHub ansehen
 (0 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Dart (277 Forks)batch import
enhancementgood first issue

Repository-Metriken

Stars
 (5.419 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 1T 11h) (12 gemergte PRs in 30 T)

Beschreibung

Is your feature request related to a problem? Please describe. I'd like to run a flutter command on a specific version defined in the fvm_config.json under flavors.

Describe the solution you'd like I'm not sure what the best practice would be, as flavor names and versions could collide. Maybe the most straight forward solution would be to allow fvm flavor to accept a command without switching.

Having this fvm_config.json:

{
  "flutterSdkVersion": "stable",
  "flavors": {
    "lts": "3.16.1",
    "main": "stable",
    "edge": "beta"
  }
}

Running my app on 3.16.1 as in fvm spawn 3.16.1 run, but using flavors, maybe fvm flavor lts run could be a possible solution. The idea is to only switch the version temporary in the same way fvm spawn does it.

Describe alternatives you've considered fvm flavor lts && fvm flutter run; fvm flavor main, but it has several problems:

  • It would not preserve $? (exit code) of fvm flutter run while staying that short (there are ugly work-arounds though)
  • It might end up in a different flavor than we started from.

Contributor Guide