minor fix dir_copy
parent
3c01d75c6a
commit
9c379eda85
|
@ -24,7 +24,7 @@ function dir_copy () {
|
||||||
while getopts 'sem' OPTION; do
|
while getopts 'sem' OPTION; do
|
||||||
case "$OPTION" in
|
case "$OPTION" in
|
||||||
s)
|
s)
|
||||||
usesudo=true
|
usesudo=sudo
|
||||||
;;
|
;;
|
||||||
e)
|
e)
|
||||||
noconfirm=true
|
noconfirm=true
|
||||||
|
@ -46,7 +46,7 @@ src=$(realpath -s $1)
|
||||||
dest=$(realpath -s $2)
|
dest=$(realpath -s $2)
|
||||||
[ ! -d "$src" ] && echo source: $src is not a directory && return 3
|
[ ! -d "$src" ] && echo source: $src is not a directory && return 3
|
||||||
[[ $merge ]] && src=${src}/
|
[[ $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
|
echo $cmd
|
||||||
[[ ! -v PS1 ]] && noconfirm=true
|
[[ ! -v PS1 ]] && noconfirm=true
|
||||||
[[ ! $noconfirm ]] && { confirm Do you want to $([[ $merge ]] && echo merge $src into || echo copy $src within) $dest? || return 0; }
|
[[ ! $noconfirm ]] && { confirm Do you want to $([[ $merge ]] && echo merge $src into || echo copy $src within) $dest? || return 0; }
|
||||||
|
|
Loading…
Reference in New Issue