♻️ Created better implementation of git rm
This commit is contained in:
parent
94c9140576
commit
ea6756b1ee
1 changed files with 10 additions and 5 deletions
|
|
@ -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")"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue