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

[Feature Request] Add alias command files for execute directly flutter command #787

Open
quyenvsp opened this issue Oct 10, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@quyenvsp
Copy link
Contributor

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" "$@"

fvm_flutter_dart.zip

@quyenvsp quyenvsp added the enhancement New feature or request label Oct 10, 2024
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

No branches or pull requests

1 participant