diff options
author | Yurii Rashkovskii <[email protected]> | 2012-07-20 23:44:28 -0700 |
---|---|---|
committer | Yurii Rashkovskii <[email protected]> | 2012-07-20 23:44:28 -0700 |
commit | 1712fe3e952cfea43acb798fb361f42a84cceb5f (patch) | |
tree | 60b77766b3dff6c72517040febfdff70b2f3df37 /kerl | |
parent | 90db4b08efb141c9f129a006f07722d21079b564 (diff) | |
parent | 07767e0ca1289f271a5d9de85433b712f4096b67 (diff) | |
download | kerl-1712fe3e952cfea43acb798fb361f42a84cceb5f.tar.gz kerl-1712fe3e952cfea43acb798fb361f42a84cceb5f.tar.bz2 kerl-1712fe3e952cfea43acb798fb361f42a84cceb5f.zip |
Merge pull request #28 from michaelklishin/master
Add a new command: cleanup
Diffstat (limited to 'kerl')
-rwxr-xr-x | kerl | 26 |
1 files changed, 25 insertions, 1 deletions
@@ -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 <build|installation> <build_name or path>" } +cleanup_usage() +{ + echo "usage: $0 cleanup <build_name|all>" +} + update_usage() { echo "usage: $0 $1 <releases|agner>" @@ -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 - |