pingbird / puro

A powerful tool for installing and upgrading Flutter versions.
https://puro.dev
Other
251 stars 13 forks source link

Set Flutter git fork globally #96

Open hanskokx opened 3 weeks ago

hanskokx commented 3 weeks ago

I see that you can use --flutter-git-url=$URL to run Puro commands with a specific fork of Flutter, however, I'd like to set this option globally. I do not see a way to do this. My first thought was to add it to prefs.json, but that didn't work:

{
  "defaultEnvironment": "stable",
  "flutterGitUrl": "https://github.com/Flutter-Foundation/flutter.git",
}
[x] FormatException: Protobuf JSON decoding failed at: root["flutterGitUrl"]. Unknown field name 'flutterGitUrl'
    flutterGitUrl
    #0      _mergeFromProto3Json.recursionHelper.<anonymous closure> (package:protobuf/src/protobuf/proto3_json.dart:358)
    #1      _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:633)
    #2      _mergeFromProto3Json.recursionHelper (package:protobuf/src/protobuf/proto3_json.dart:338)
    #3      _mergeFromProto3Json (package:protobuf/src/protobuf/proto3_json.dart:416)
    #4      GeneratedMessage.mergeFromProto3Json (package:protobuf/src/protobuf/generated_message.dart:267)
    #5      _readGlobalPrefs (package:puro/src/config.dart:720)
    <asynchronous suspension>
    #6      checkIfUpdateAvailable (package:puro/src/version.dart:311)
    <asynchronous suspension>
    #7      PuroCommandRunner.runCommand (package:puro/src/command.dart:344)
    <asynchronous suspension>
    #8      main (package:puro/src/cli.dart:256)
    <asynchronous suspension>

[x] Puro crashed! Please file an issue at https://github.com/pingbird/puro
    Consider running the command with a higher log level: `--log-level=4`

Is this functionality missing? Or am I simply doing something wrong?

pingbird commented 3 weeks ago

It should be pretty easy to add global and environment-specific overrides here, but there is more to change than just the git url, such as the versions json and engine artifacts.

hanskokx commented 3 weeks ago

The corresponding fmv instructions for switching to using Flock (which is my ultimate goal here) can be found on https://flutterfoundation.dev/