From 06e9a26563ed6e568e9182de09f3e9a25f35a2d3 Mon Sep 17 00:00:00 2001 From: committer Date: Wed, 15 May 2024 07:30:46 -0500 Subject: [PATCH] u --- scripts/99_deploy.sh | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/scripts/99_deploy.sh b/scripts/99_deploy.sh index 9c91003..909def4 100644 --- a/scripts/99_deploy.sh +++ b/scripts/99_deploy.sh @@ -60,6 +60,7 @@ deploy_file() { _src_path=$1 _trg_path=$2 _no_chown=$3 + _recursive=$4 file_name=$(basename ${_trg_path}) echo "" @@ -69,14 +70,22 @@ deploy_file() { cp --force --recursive ${_src_path} ${_trg_path} # only chown if _no_chown variable is empty - if [ -z "${_no_chown}" ]; then + if [[ ${_no_chown} != "no_chown" ]] ; then # if the target path ends with a slash, we have a directory if [[ "$_trg_path" == */ ]] then echo "(ignore potential \"chown: cannot access\" error, which will occur if there are no dot-files in the directory)" - chown ${user}:${user} ${_trg_path}* - # https://serverfault.com/questions/156437/how-to-chown-a-directory-recursively-including-hidden-files-or-directories - chown ${user}:${user} ${_trg_path}.[^.]* + + if [[ ${_recursive} != "recursive" ]] ; then + echo "one" + #chown ${user}:${user} ${_trg_path}* + # https://serverfault.com/questions/156437/how-to-chown-a-directory-recursively-including-hidden-files-or-directories + #chown ${user}:${user} ${_trg_path}.[^.]* + else + echo "recursive" +# chown -R ${user}:${user} ${_trg_path}* +# chown -R ${user}:${user} ${_trg_path}.[^.]* + fi else chown ${user}:${user} ${_trg_path} fi @@ -190,7 +199,7 @@ if [ ${operation} == "dots" ] ; then file_name=sdras.night-owl-2.0.1-universal file_path=/home/${user}/.vscode-oss/extensions mkdir -p ${file_path} - deploy_file "${dots_trg}/vscodium/${file_name}" "${file_path}/" + deploy_file "${dots_trg}/vscodium/${file_name}" "${file_path}/" # i3wm if [ ${I3WM} == "true" ] ; then