From 07767e0ca1289f271a5d9de85433b712f4096b67 Mon Sep 17 00:00:00 2001 From: "Michael S. Klishin" Date: Sat, 21 Jul 2012 10:40:30 +0400 Subject: Add a command that cleans up downloaded archives and build artifacts --- kerl | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'kerl') diff --git a/kerl b/kerl index d20025c..c4485e4 100755 --- a/kerl +++ b/kerl @@ -111,6 +111,7 @@ usage() echo " active Print the path of the active installation" echo " status Print available builds and installations" echo " prompt Print a string suitable for insertion in prompt" + echo " cleanup Remove compilation artifacts (use after installation)" exit 1 } @@ -628,6 +629,11 @@ delete_usage() echo "usage: $0 delete " } +cleanup_usage() +{ + echo "usage: $0 cleanup " +} + update_usage() { echo "usage: $0 $1 " @@ -847,8 +853,26 @@ case "$1" in fi exit 0 ;; + cleanup) + if [ $# -ne 2 ]; then + cleanup_usage + exit 1 + fi + case "$2" in + all) + echo "Cleaning up compilation products for ALL builds" + rm -rf $KERL_BUILD_DIR/* + rm -rf $KERL_DOWNLOAD_DIR/* + echo "Cleaned up all compilation products under $KERL_BUILD_DIR" + ;; + *) + echo "Cleaning up compilation products for $3" + rm -rf $KERL_BUILD_DIR/$3 + echo "Cleaned up all compilation products under $KERL_BUILD_DIR" + ;; + esac + ;; *) echo "unkwnown command: $1"; usage; exit 1 ;; esac - -- cgit v1.2.3