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
[Feature Request] fvm exec #317
Comments
@2ZeroSix Do you mind going into a bit more detail on this, right now we have the |
simplified example of common use case in proprietary projects:(when os is always posix) flutter pub get
flutter pub run build_runner build --delete-conflicting-outputs --verbose
flutter analyze
flutter test
real life example of open source repomelos commands in FlutterFire repo: https://github.com/FirebaseExtended/flutterfire/blob/master/melos.yaml
|
@2ZeroSix Sorry for the delay, there seems to be a similar conversation to helping solve this on Melos through invertase/melos#81, I am not opposed to the idea, but not sure when I will be able to get to it, is that something you would like to do a PR for? |
@2ZeroSix I took a better look at it, and I think all the pieces are there to be able to accomplish this, its very similar to the |
You can also create small scripts with names file
file
Add these scripts to your path and you will be able to use This is useful when you only have flutter installed from fvm. |
mac os /Users/.pub-cache/bin/melos #!/usr/bin/env sh
# This file was created by pub v2.16.1.
# Package: melos
# Version: 1.4.0
# Executable: melos
# Script: melos
if [ -f /Users/litianyi/.pub-cache/global_packages/melos/bin/melos.dart-2.16.1.snapshot ]; then
dart "/Users/litianyi/.pub-cache/global_packages/melos/bin/melos.dart-2.16.1.snapshot" "$@"
# The VM exits with code 253 if the snapshot version is out-of-date.
# If it is, we need to delete it and run "pub global" manually.
exit_code=$?
if [ $exit_code != 253 ]; then
exit $exit_code
fi
fvm flutter pub global run melos:melos "$@"
else
fvm flutter pub global run melos:melos "$@"
fi
dart pub global run melos:melos => fvm flutter pub global run melos:melos @festelo good |
Prerelease version on https://pub.dev/packages/fvm/versions/2.3.0-dev.0 would appreciate some testing on any of the use cases mentioned. Will leave this open for comments |
This has been deployed live on 2.3.0 |
Describe the solution you'd like
command to execute any command with environment set up for flutter sdk found by fvm
fvm exec
Describe alternatives you've considered
currently it's accomplished by overriding PATH like this
but this code is not portable between windows and posix systems
Additional context
many repositories use custom scripts to maintain repository/infrastructure, setup something specific or add shortcuts for some flutter/dart commands
It would become similar to what bundler does in
bundle exec
The text was updated successfully, but these errors were encountered: