minor fix dir_copy
parent
3c01d75c6a
commit
9c379eda85
|
@ -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; }
|
||||
|
|
Loading…
Reference in New Issue