Sha256: 0658e2f66206cbfd59f08d16f26f445750401992ed2aeb2284c8d16384e234e0

Contents?: true

Size: 964 Bytes

Versions: 23

Compression:

Stored size: 964 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

    current_path="${rvm_path}/${cleanup_type}"

    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 repos src log" ;;
  archives) cleanup "archives" ;;
  repos)    cleanup "repos" ;;
  sources)  cleanup "src" ;;
  logs)     cleanup "log" ;;
  help)     usage ;;
  *)        usage ; exit 1;;
esac

exit $?

Version data entries

23 entries across 23 versions & 2 rubygems

Version Path
rvm-1.1.4 scripts/cleanup
rvm-1.1.3 scripts/cleanup
rvm-1.1.2 scripts/cleanup
rvm-1.1.1 scripts/cleanup
rvm-1.1.0 scripts/cleanup
rvm-1.0.23 scripts/cleanup
rvm-1.0.22 scripts/cleanup
rvm-1.0.21 scripts/cleanup
rvm-1.0.20 scripts/cleanup
rvm-1.0.19 scripts/cleanup
rvm-1.0.18 scripts/cleanup
rvm-1.0.17 scripts/cleanup
rvm-1.0.15 scripts/cleanup
gemrage-1.0.0 vendor/ruby/1.8/gems/rvm-1.0.14/scripts/cleanup
gemrage-0.4.1 vendor/ruby/1.8/gems/rvm-1.0.14/scripts/cleanup
gemrage-0.4.0 vendor/ruby/1.8/gems/rvm-1.0.14/scripts/cleanup
gemrage-0.3.2 vendor/ruby/1.8/gems/rvm-1.0.14/scripts/cleanup
gemrage-0.3.1 vendor/ruby/1.8/gems/rvm-1.0.14/scripts/cleanup
gemrage-0.3.0 vendor/ruby/1.8/gems/rvm-1.0.14/scripts/cleanup
gemrage-0.2.0 vendor/ruby/1.8/gems/rvm-1.0.14/scripts/cleanup