Sha256: e2f95b5da7924da63c1b9152610400364232e0bd73bb774c0b67eec8d62a3c56

Contents?: true

Size: 1.02 KB

Versions: 1

Compression:

Stored size: 1.02 KB

Contents

#!/usr/bin/env bash

source "$rvm_scripts_path/base"

usage() {
  echo "Usage: rvm tools {identifier,path-identifier,strings}" 1>&2
  exit 1
}

# Return the identifier that's current in use.
tools_identifier() {
  __rvm_environment_identifier
}

tools_path_identifier() {
  if [[ -z "$1" || ! -d "$1" ]]; then
    echo "Usage: rvm tools path-identifier 'path-to-heck'"
    return 1
  fi

  source "$rvm_scripts_path/rvm"
  builtin cd "$1"
  rvm_promptless=1 __rvm_project_rvmrc
  rvmrc_result="$?"
  __rvm_environment_identifier
  exit $rvmrc_result
}

tools_strings() {
  for ruby_name in "$@"; do
    __rvm_unset_ruby_variables
    rvm_ruby_string="$ruby_name"
    if { __rvm_ruby_string && __rvm_select; } >/dev/null 2>&1; then
      basename "$rvm_ruby_gem_home"
    else
      echo ""
    fi
  done
}

[[ -z "$1" ]] && usage

action="$1"; shift

case "$action" in
  identifier)      tools_identifier ;;
  path-identifier) tools_path_identifier "$@" ;;
  strings)         tools_strings "$@" ;;
  *)               usage ;;
esac

exit $?

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rvm-1.0.2 scripts/tools