Sha256: 12193cb2f6d6e6464d548b01c98c20bfd168e6ae7b7d8c049cc1e348739625a3

Contents?: true

Size: 867 Bytes

Versions: 6

Compression:

Stored size: 867 Bytes

Contents

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

usage() {
  printf "Usage: 'rvm cleanup {all,archives,repos,sources,logs}'\n"
  printf "       Cleans up the directory tree for the specified item.\n"
  exit 1
}

cleanup() {
  for cleanup_type in $1; do
    eval "current_path=\"\$rvm_${cleanup_type}_path\""
    if [[ -n "$current_path" && -d "$current_path" && "$current_path" != "/" ]]; then
      $rvm_scripts_path/log "info" "Cleaning up rvm directory '$current_path'"
      rm -rf "$current_path"/* >/dev/null 2>&1
    fi
  done; unset cleanup_type current_path
}

# Exit when there is no argument.
[[ -z "$1" ]] && usage

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rvm-0.1.45 scripts/cleanup
rvm-0.1.44 scripts/cleanup
rvm-0.1.43 scripts/cleanup
rvm-0.1.42 scripts/cleanup
rvm-0.1.41 scripts/cleanup
rvm-0.1.40 scripts/cleanup