Fix configuration copy outside homedir

master
Quentin Duchemin 2023-04-11 11:50:02 +02:00
parent 9ecf704015
commit 33a57ad978
Signed by: Chosto
GPG Key ID: 96AB8AE7DFEA3D74
1 changed files with 3 additions and 2 deletions

View File

@ -88,7 +88,7 @@ if [ ! -z "$INIT" ]; then
chsh -s $(which zsh) chsh -s $(which zsh)
# https://man.archlinux.org/man/rofi-dmenu.5 # https://man.archlinux.org/man/rofi-dmenu.5
echo -e "* Symlink dmenu → rofi..." echo -e "* Symlink dmenu → rofi..."
sudo ln -s /usr/bin/rofi /usr/bin/dmenu sudo ln -sf /usr/bin/rofi /usr/bin/dmenu
echo -e "* Enabling NetworkManager..." echo -e "* Enabling NetworkManager..."
sudo systemctl enable --now NetworkManager sudo systemctl enable --now NetworkManager
# So that "Open in Terminal" works in Nemo # So that "Open in Terminal" works in Nemo
@ -123,9 +123,10 @@ for f in `find ${CONFIG} -type f -name ${DEST_FILENAME}`; do
DEST=`cat ${f}` DEST=`cat ${f}`
# Get all files, either regular files or symlinks, which are not the destination file nor specific desktop/laptop files # Get all files, either regular files or symlinks, which are not the destination file nor specific desktop/laptop files
# This is because if desktop/laptop files exist, they already have a symlink pointing to them at this stage # This is because if desktop/laptop files exist, they already have a symlink pointing to them at this stage
for config_file in `find ${DIR} -regextype emacs -mindepth 1 -type f -not \( -regex "*.${ENV_EXT_REGEXP}" -o -name "${DEST_FILENAME}" \)`; do for config_file in `find ${DIR} -regextype posix-extended -mindepth 1 \( -type f -o -type l \) -not \( -regex "${ENV_EXT_REGEXP}" -o -name "${DEST_FILENAME}" \)`; do
# Now copy to destination # Now copy to destination
sudo mkdir -p ${DEST} sudo mkdir -p ${DEST}
# ##* strips the base path, so we manipulate absolute paths by concatening with $DEST
check_copy "${config_file}" "sudo cp ${config_file} ${DEST}" "sudo rm ${DEST}/${config_file##*/}" check_copy "${config_file}" "sudo cp ${config_file} ${DEST}" "sudo rm ${DEST}/${config_file##*/}"
done done
done done