Sha256: 585b9ca1553c35548a1fab1bfed47e1d0b1989e1431d5bb7cefbd4178fdefb14

Contents?: true

Size: 962 Bytes

Versions: 5

Compression:

Stored size: 962 Bytes

Contents

#!/usr/bin/env bash
rvm_base_except="selector"
source "$rvm_path/scripts/base"

usage() {
  printf "

  Usage:

    rvm cleanup {all,archives,repos,sources,logs}

  Description:

    Cleans up the directory tree for the specified item.
"
return 0
}

cleanup() {
  local cleanup_type current_path

  for cleanup_type in $1; do

    eval "current_path=\"\$rvm_${cleanup_type}_path\""

    if [[ -n "$current_path" && -d "$current_path" && "$current_path" != "/" ]]; then

      "$rvm_path/scripts/log" "info" \
        "Cleaning up rvm directory '$current_path'"

      rm -rf "$current_path"/* >/dev/null 2>&1

    fi

  done

  return 0
}

# Exit when there is no argument.
if [[ -z "${1:-""}" ]] ; then
  usage
fi

case "$1" in
  all)      cleanup "archives repo src log" ;;
  archives) cleanup "archives" ;;
  repos)    cleanup "repo" ;;
  sources)  cleanup "src" ;;
  logs)     cleanup "log" ;;
  help)     usage ;;
  *)        usage ; exit 1;;
esac

exit $?

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rvm-1.0.11 scripts/cleanup
rvm-1.0.10 scripts/cleanup
rvm-1.0.9 scripts/cleanup
rvm-1.0.8 scripts/cleanup
rvm-1.0.7 scripts/cleanup