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

Allow global flutter binary #21

Closed
JasCodes opened this issue Oct 16, 2019 · 4 comments · Fixed by #60
Closed

Allow global flutter binary #21

JasCodes opened this issue Oct 16, 2019 · 4 comments · Fixed by #60
Assignees
Labels
enhancement New feature or request

Comments

@JasCodes
Copy link
Contributor

Hey @leoafarias

Dart implementation allow project specific version, which is cool, but to be honest, I still want global flutter version like go version. Right now I am just soft linking to /usr/local/bin, will be cool if you allow global linking and switch will cli as before.

Thx

@CaiJingLong
Copy link
Contributor

CaiJingLong commented Oct 16, 2019

I believe that this can be achieved.
Let the author decide if you want to do it.

There are 3 ways:

  1. Use a special directory, such as ~/fvm/bin, and then let the user add this directory to the $PATH environment variable.
  2. Add link file to the system's common bin directory, such as /usr/local/bin/flutter under mac.
  3. Or since the user has used pub global, use pub global path to do it.

Of course, the project level is still valid, but you can use global to do this if you don't find it in the project.

The global does not have to be fvm, it can be flutter, so you only need to use fvm to switch versions, and the flutter command can be used every where.

@leoafarias
Copy link
Owner

My thinking on this is that is mostly not touching a flutter version in the machine. The last version of fvm allowed to switch globally but I did find that was overkill for some cases.

We are using fvm within our business to switch to specific versions of our app sometimes to test a different channel to see if solved an issue or would be to make sure we attach a version that has been tested with the app.

Attaching to the global is easy in the past I just used what’s as set as a path in .bash_profile.

I am just not sure fvm should go down that route as that version of flutter will impact everything you run on flutter outside of fvm.

I wonder if setting a default fvm version that you can set would be a work around for this

@davidmartos96
Copy link
Contributor

@leoafarias I have this feature on my fork. If I do fvm use {version} --global a soft link folder named default is created in the fvm home folder. After that I place the path to the flutter binary in my PATH and I can use the version globally.
I had the need to do it since I am using go-flutter, where the Flutter version should be beta and it uses the binary in the PATH by default.
Would you like me to create a PR? I see this is tagged as an enhancement.

@leoafarias
Copy link
Owner

@davidmartos96 yes this would be great

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants