fvm
fvm copied to clipboard
[Feature Request] Add alias command files for execute directly `flutter` command
Describe the solution you'd like
I would like to run flutter instead of fvm flutter to execute command with current selected version
Describe alternatives you've considered
I have set PATH to alias folder which include shell file allow me execute directly flutter instead of fvm flutter
It work like charm over 2 years without any errors, so can consider add these files to release?
Structure
- fvm/
- alias/
- src/
- versions/
- fvm.bat
Windows
alias/fvm.bat
@echo off
set SCRIPTPATH=%~dp0..\
set arguments=%*
"%SCRIPTPATH%\fvm.bat" %arguments%
alias/dart.bat
@echo off
set SCRIPTPATH=%~dp0..\
set arguments=%*
"%SCRIPTPATH%\fvm.bat" dart %arguments%
alias/flutter.bat
@echo off
set SCRIPTPATH=%~dp0..\
set arguments=%*
"%SCRIPTPATH%\fvm.bat" flutter %arguments%
Git bash
alias/fvm
#!/usr/bin/env bash
fvm.bat "$@"
alias/dart
#!/usr/bin/env bash
dart.bat "$@"
alias/flutter
#!/usr/bin/env bash
flutter.bat "$@"
Linux / MacOS
alias/fvm
#!/bin/sh
# This script drives the standalone fvm package, which bundles together a
# Dart executable and a snapshot of fvm.
follow_links() {
# Use `readlink -f` if it exists, but fall back to manually following symlnks
# for systems (like older Mac OS) where it doesn't.
file="$1"
if readlink -f "$file" 2>&-; then return; fi
while [ -h "$file" ]; do
file="$(readlink "$file")"
done
echo "$file"
}
# Unlike $0, $BASH_SOURCE points to the absolute path of this file.
path=`dirname "$(follow_links "$0")"`
exec "$path/../src/dart" "$path/../src/fvm.snapshot" "$@"
alias/dart
#!/bin/sh
# This script drives the standalone fvm package, which bundles together a
# Dart executable and a snapshot of fvm.
follow_links() {
# Use `readlink -f` if it exists, but fall back to manually following symlnks
# for systems (like older Mac OS) where it doesn't.
file="$1"
if readlink -f "$file" 2>&-; then return; fi
while [ -h "$file" ]; do
file="$(readlink "$file")"
done
echo "$file"
}
# Unlike $0, $BASH_SOURCE points to the absolute path of this file.
path=`dirname "$(follow_links "$0")"`
exec "$path/../src/dart" "$path/../src/fvm.snapshot" "dart" "$@"
alias/flutter
#!/bin/sh
# This script drives the standalone fvm package, which bundles together a
# Dart executable and a snapshot of fvm.
follow_links() {
# Use `readlink -f` if it exists, but fall back to manually following symlnks
# for systems (like older Mac OS) where it doesn't.
file="$1"
if readlink -f "$file" 2>&-; then return; fi
while [ -h "$file" ]; do
file="$(readlink "$file")"
done
echo "$file"
}
# Unlike $0, $BASH_SOURCE points to the absolute path of this file.
path=`dirname "$(follow_links "$0")"`
exec "$path/../src/dart" "$path/../src/fvm.snapshot" "flutter" "$@"