Add documentation to optionally allow users to forward all flutter
, dart
calls to fvm
#719
Labels
enhancement
New feature or request
flutter
, dart
calls to fvm
#719
Before creating a feature request make sure the suggestion fit within our principles
Is your feature request related to a problem? Please describe.
Yes, I use a few scripts which rely on using naked
flutter
calls instead offvm
since they operate on the CI as well. However, this creates an issue when working seamlessly withfvm
on my local machine. I'm assuming a lot of folks would end up with such a situation.Describe the solution you'd like
I feel it might benefit a lot of people if we include a documentation that allowed people to redirect naked flutter/dart calls to fvm. I understand this might create slight friction with fvm principles, however since its documentation and strictly optional, Im assuming it wouldn't be an issue. The documentation can be along the following lines
Reroute flutter & dart commands (Optional)
You can run the commands below so that all calls invoking
flutter
ordart
are automatically redirected to usingfvm flutter
orfvm dart
.On Mac
sudo echo 'fvm flutter ${@:1}' > "/usr/local/bin/flutter" && sudo chmod +x /usr/local/bin/flutter
sudo echo 'fvm dart ${@:1}' > "/usr/local/bin/dart" && sudo chmod +x /usr/local/bin/dart
On Linux
echo 'fvm flutter ${@:1}' > "$HOME/.local/bin/flutter" && chmod +x "$HOME/.local/bin/flutter"
echo 'fvm dart ${@:1}' > "$HOME/.local/bin/dart" && chmod +x "$HOME/.local/bin/dart"
Remove reroutes
On Mac
sudo rm /usr/local/bin/flutter
sudo rm /usr/local/bin/dart
On Linux
rm "$HOME/.local/bin/dart"
rm "$HOME/.local/bin/flutter"
Describe alternatives you've considered
I have considered command aliases as an alternate approach which are less intrusive however, they wont work with scripts unless you export the corresponding environment files from within the script.
Additional context
I'm still figuring a way to do an equivalent in windows but I don't own a machine so it would be great if someone else can provide a snippet. There are caveats to this approach as well, mainly if a user already has installed flutter via brew or any other native package managers, the binaries may conflict. I'd assume adding a note around this would inform users about the same.
The text was updated successfully, but these errors were encountered: