Sha256: 9825f882258650ae9bef7c9df6df05aed07786ceeb3d11bb3dca45597cd03c1f

Contents?: true

Size: 847 Bytes

Versions: 2

Compression:

Stored size: 847 Bytes

Contents

#!/usr/bin/env bash

if [[ "$rvm_trace_flag" -eq 2 ]] ; then set -x ; export rvm_trace_flag ; fi

# Recursive loops, oh my!
unset rvm_default_flag

source "$rvm_scripts_path/base"

usage() {
  printf "Usage: rvm env [ruby_string] [--path]\n"
}

args=($*)
environment_name="${args[0]}"

if [[ -z "$environment_name" ]]; then
  usage ; exit 1
fi

# Exit when we encounter an unknown environment name.
__rvm_become "$environment_name"

if [[ "$?" = 0 ]]; then
  __rvm_use
  environment_file_path="$rvm_environments_path/$(__rvm_environment_identifier)"
  # Echo the path or environment file.
  if [[ -n "$rvm_path_flag" ]]; then
    echo "$environment_file_path"
  else
    cat "$environment_file_path"
  fi
  unset environment_file_path
  result=0
else
  result=1
fi

unset rvm_ruby_string environment_name
__rvm_unset_ruby_variables

exit $result

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rvm-1.0.4 scripts/env
rvm-1.0.3 scripts/env