mirror of
https://github.com/DefectingCat/dotfiles
synced 2025-07-15 08:41:36 +00:00
fix backup folder
if target not exist, do not delete source
This commit is contained in:
@ -2,11 +2,11 @@
|
||||
|
||||
# $1 source $2 target $3 remove old
|
||||
function backup_folder() {
|
||||
if [ "$3" ]; then
|
||||
rm -rf "$3"
|
||||
fi
|
||||
|
||||
if [ -r "$1" ]; then
|
||||
if [ "$3" ]; then
|
||||
rm -rf "$3"
|
||||
fi
|
||||
|
||||
echo "straing copy $1 to $2"
|
||||
cp -aR "$1" "$2"
|
||||
else
|
||||
|
Reference in New Issue
Block a user