Make rs-rm command more generic

This commit is contained in:
Janek Bevendorff 2016-11-17 02:12:28 +01:00
parent 2c4d2915e5
commit 4b84ad5997
1 changed files with 4 additions and 11 deletions

View File

@ -3,7 +3,7 @@
# Copyright (C) 2013-2016 Janek Bevendorff # Copyright (C) 2013-2016 Janek Bevendorff
# Website: http://www.refining-linux.org/ # Website: http://www.refining-linux.org/
# #
# Recursively adjust permissions of given directory and remove it. # Recursively adjust permissions of given file or directory and remove it.
# #
# The MIT License (MIT) # The MIT License (MIT)
# #
@ -28,17 +28,10 @@
if [ "$1" == "" ]; then if [ "$1" == "" ]; then
. rs-version . rs-version
echo "Usage: $(basename $0) <flags> <directory>" echo "Usage: $(basename $0) [flags] <file>"
exit exit
fi fi
flags="$1" chmod -R +w "${@: -1}"
dir="$2" rm ${@}
if [ "$2" == "" ]; then
dir="$1"
flags=""
fi
chmod -R +w "$dir"
rm $flags "$dir"