diff options
Diffstat (limited to '')
-rwxr-xr-x | etc/linux-clean-tree.sh | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/etc/linux-clean-tree.sh b/etc/linux-clean-tree.sh new file mode 100755 index 0000000..80a858c --- /dev/null +++ b/etc/linux-clean-tree.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +# WARNING: +# +# this script will delete *everything* that is not +# under version control +# + +POSITIONAL=() +CLEAN_ALL=false + +while [[ $# -gt 0 ]]; do + key="$1" + + case $key in + -a|--all) + CLEAN_ALL=true + shift + ;; + *) + POSITIONAL+=("$1") + shift + ;; + esac +done + +if [ "$CLEAN_ALL" = true ]; then + git clean -d -x -f +else + git clean -d -X -f +fi |