fvm
fvm copied to clipboard
[Feature Request] command to just return active version
Before creating a feature request make sure the suggestion fit within our principles
Is your feature request related to a problem? Please describe. I'm setting up FVM with Github actions and want to cache the Flutter SDK.
I'd rather not cache the entire FVM cache directory, but just the active Flutter SDK version.
I can't seem to find an FVM command that will just return the active version, e.g. beta, dev etc.
Describe the solution you'd like A parameter added to the list command which only prints the active version:
fvm list --active
prints beta
Describe alternatives you've considered
Additional context
@josh-burton by the active version you mean the active version within a specific project? fvm doctor
returns a lot of information about the current environment fvm is running in, maybe a flag fvm doctor --active-release
might be a better option to just output the active release being used within the env.
Let me know what you think.
Hi @josh-burton, I experimented a lot with FMV in Github actions but found it the easiest to just use plain Flutter there.
I created a PR in subosito/flutter-action which allows to read FVM config files easily. https://github.com/subosito/flutter-action/pull/103
Without this change I am using this:
- name: Determine Flutter version
uses: antifree/[email protected]
with:
filename: '.fvm/fvm_config.json'
prefix: fvm
- uses: subosito/flutter-action@v1
with:
flutter-version: ${{ env.fvm_flutterSdkVersion }}
@kuhnroyal how does this impact the issue with the feature flags for version numbers? Does the action handles that correctly?
@kuhnroyal how does this impact the issue with the feature flags for version numbers? Does the action handles that correctly?
You are right, I have not used it with such a version string. That will probably not work. I wonder if we should create a simple FVM action that reads the config file and provides the environment variables to configure the "semi-official" Flutter action.
However, this may be not what Josh needs. Didn't mean to hijack the issue :)
An official action would be great!
fvm doctor --active-release
would also work. I wonder if we need a command to return just the local project version, and one to return the global version as well.
Maybe fvm doctor --active-release
and fvm doctor --global-release
.
I currently have FVM working in actions by using the official dart action, then activating FVM via dart pub, and caching the FVM install path.
@josh-burton i am not sure when I would be able to get to that but would not mind reviewing a PR to the flag and/or a fvm action.
I don't think a global version flag is needed however.
I created a simple action that parses the FVM config file. It can be used together with the semi-official flutter-action as well as with custom setup.
https://github.com/kuhnroyal/flutter-fvm-config-action
@kuhnroyal We have some things like that and Docker images, was thinking about linking to them on the documentation. Any suggestions?
Yea maybe add some section linking to 3rd party tools and helpers.
On a freshly VM/Build Node that has no previous flutter version installed via fvm, you can do this:
# install brew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# install fvm
brew tap leoafarias/fvm
brew install fvm
# install project's flutter version
fvm install
# set project's flutter version as global
echo 1 | fvm global
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.