From 33a57ad9789a070080ea4d2da9a3311037de2075 Mon Sep 17 00:00:00 2001 From: Quentin Duchemin Date: Tue, 11 Apr 2023 11:50:02 +0200 Subject: [PATCH] Fix configuration copy outside homedir --- .init_config.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.init_config.sh b/.init_config.sh index a5f0261..4cc8291 100755 --- a/.init_config.sh +++ b/.init_config.sh @@ -88,7 +88,7 @@ if [ ! -z "$INIT" ]; then chsh -s $(which zsh) # https://man.archlinux.org/man/rofi-dmenu.5 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..." sudo systemctl enable --now NetworkManager # 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}` # 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 - 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 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##*/}" done done