Sha256: 4373a44c9790e24bf92b20bf271d65ef0146eee69b784ecdc3072cc4b09b860b

Contents?: true

Size: 1.08 KB

Versions: 2

Compression:

Stored size: 1.08 KB

Contents

#!/usr/bin/env bash

# General tools for manipulating patches
# and dealing with patches.

# Returns the path used to look for a patch given a specific name.
__rvm_patch_lookup_path() {
  echo "/"
  [[ -n "$rvm_patch_original_pwd" ]] && echo "$rvm_patch_original_pwd/"
  echo "$PWD/"
  __rvm_ruby_string_paths_under "$rvm_patches_path" | sed 's/$/\//'
}

__rvm_expand_patch_name() {
  local name="$1"
  [[ -z "$name" ]] && return 0
  expanded_patch_name="$("$rvm_scripts_path/patchsets" show "$name")"
  if [[ "$?" == "0" ]]; then
    echo "${expanded_patch_name}"
  elif [[ "$name" != "default" ]]; then
    echo "$name"
  fi ; unset expanded_patch_name
}

# Return the full patch for a given patch.
__rvm_lookup_full_patch_path() {
  # Absolute path, pwd and then finally the rvm patches path.
  for directory in $(__rvm_patch_lookup_path) ; do
    for extension in {"",.patch,.diff}; do
      patch_path="${directory}${1}${extension}"
      if [[ -s "$patch_path" ]]; then
        echo "$patch_path"
        return
      fi
    done; unset extension patch_path
  done; unset directory
  return 1
}

Version data entries

2 entries across 2 versions & 1 rubygems

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