Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support to fvm config json #29

Open
juliogc opened this issue Apr 20, 2022 · 3 comments
Open

Support to fvm config json #29

juliogc opened this issue Apr 20, 2022 · 3 comments

Comments

@juliogc
Copy link

juliogc commented Apr 20, 2022

Motivation

Unfortunately, asdf-vm isn't well known as we wish and usually, people tend to work with the specific language version manager so it's very common to face legacy version files instead of the .tool-versions.

Suggestion

As an asdf heavy user, it would be great if we could experience compatibility with these other version managers when working with legacy_version_files enabled, something similar to what we see on asdf-nodejs handling with .nvmrc or .node-version files.

Straight to the point, I believe it would be great if this plugin was able to handle the version specified on the .fvm/fvm_config.json.

Here's an example of this file:

{
  "flutterSdkVersion": "2.8.1",
  "flavors": {}
}
@oae
Copy link
Collaborator

oae commented Apr 21, 2022

I will look into this when I have time. Thank you for the feedback.

@juliogc
Copy link
Author

juliogc commented Apr 21, 2022

@oae thanks for your interest!

In my local environment, I build a simple implementation of this feature and I would like to share it here with you.
It worked very well with stable versions, but I don't test it with the other types available on the listing, like pre-beta, beta, dev, etc and that's why I don't make a PR with it.

bin/list-legacy-filenames

#!/usr/bin/env bash

echo ".fvm/fvm_config.json"

bin/parse-legacy-file

#!/usr/bin/env bash

version=$(cat "$1" | jq ".flutterSdkVersion" | sed -r 's/^"|"$//g');
echo "$version-stable";

@joelpaulkoch
Copy link

This would also help for builds on codemagic, they accept setting the flutter version using fvm_config.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants