minor fix dir_copy

master
David Kebler 2023-03-12 10:46:05 -07:00
parent 3c01d75c6a
commit 9c379eda85
1 changed files with 2 additions and 2 deletions

View File

@ -24,7 +24,7 @@ function dir_copy () {
while getopts 'sem' OPTION; do
case "$OPTION" in
s)
usesudo=true
usesudo=sudo
;;
e)
noconfirm=true
@ -46,7 +46,7 @@ src=$(realpath -s $1)
dest=$(realpath -s $2)
[ ! -d "$src" ] && echo source: $src is not a directory && return 3
[[ $merge ]] && src=${src}/
cmd="$usesudo rsync --exclude *[C]ache* --exclude node_modules --progress -aAru $src $dest"
cmd="$usesudo rsync --exclude *[C]ache* --progress -aAru $src $dest"
echo $cmd
[[ ! -v PS1 ]] && noconfirm=true
[[ ! $noconfirm ]] && { confirm Do you want to $([[ $merge ]] && echo merge $src into || echo copy $src within) $dest? || return 0; }