u
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user