This commit is contained in:
committer
2024-05-15 07:30:46 -05:00
parent 2947a8a4df
commit 06e9a26563

View File

@@ -60,6 +60,7 @@ deploy_file() {
_src_path=$1 _src_path=$1
_trg_path=$2 _trg_path=$2
_no_chown=$3 _no_chown=$3
_recursive=$4
file_name=$(basename ${_trg_path}) file_name=$(basename ${_trg_path})
echo "" echo ""
@@ -69,14 +70,22 @@ deploy_file() {
cp --force --recursive ${_src_path} ${_trg_path} cp --force --recursive ${_src_path} ${_trg_path}
# only chown if _no_chown variable is empty # 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 the target path ends with a slash, we have a directory
if [[ "$_trg_path" == */ ]] if [[ "$_trg_path" == */ ]]
then then
echo "(ignore potential \"chown: cannot access\" error, which will occur if there are no dot-files in the directory)" 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 if [[ ${_recursive} != "recursive" ]] ; then
chown ${user}:${user} ${_trg_path}.[^.]* 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 else
chown ${user}:${user} ${_trg_path} chown ${user}:${user} ${_trg_path}
fi fi
@@ -190,7 +199,7 @@ if [ ${operation} == "dots" ] ; then
file_name=sdras.night-owl-2.0.1-universal file_name=sdras.night-owl-2.0.1-universal
file_path=/home/${user}/.vscode-oss/extensions file_path=/home/${user}/.vscode-oss/extensions
mkdir -p ${file_path} mkdir -p ${file_path}
deploy_file "${dots_trg}/vscodium/${file_name}" "${file_path}/" deploy_file "${dots_trg}/vscodium/${file_name}" "${file_path}/"
# i3wm # i3wm
if [ ${I3WM} == "true" ] ; then if [ ${I3WM} == "true" ] ; then