♻️ Created better implementation of git rm

This commit is contained in:
z3rOR0ne 2022-07-20 08:44:33 -07:00
parent 94c9140576
commit ea6756b1ee

View file

@ -34,11 +34,6 @@ shift $(( $OPTIND - 1 ))
# BEGIN MAIN SCRIPT
# =================
if [ -d .git ] ; then
git rm "$@"
exit 0
fi
if [ ! -d $archivedir ] ; then
if [ ! -w $HOME ] ; then
echo "$0 failed: can't create $archivedir in $HOME " >&2
@ -48,6 +43,16 @@ if [ ! -d $archivedir ] ; then
chmod 700 $archivedir # A little bit of privacy, please
fi
if [ -d .git ] ; then
for arg
do
newname="$archivedir/$(date "+%S.%M.%H.%m").$(basename "$arg")"
$copy "$arg" "$newname"
done
git rm "$@"
exit 0
fi
for arg
do
newname="$archivedir/$(date "+%S.%M.%H.%m").$(basename "$arg")"