From ab90cd4ba5c7f3740393ca730a263e21d879be4b Mon Sep 17 00:00:00 2001 From: Santiago Lo Coco Date: Tue, 21 Dec 2021 18:01:05 -0300 Subject: [PATCH] Update linkFile.sh --- linkFiles.sh | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/linkFiles.sh b/linkFiles.sh index 257dbc7..cfcf89a 100755 --- a/linkFiles.sh +++ b/linkFiles.sh @@ -2,30 +2,31 @@ DOTFILES_HOME=$(pwd -P) DOTFILES_CONFIG="$(pwd -P)/.config" +DOTFILES_ICONS="$(pwd -P)/.icons" +DOTFILES_SSH="$(pwd -P)/.ssh" for src in $(find -H "$DOTFILES_HOME" -not -path '*.git*' -not -path '*.config*' -not -path '*.ssh*' -not -path '*.icons*'); do if [ "$(basename "${src}")" = "CocoRice" ]; then - continue + continue fi - #echo "$src" - #echo "$HOME/test/$(basename "${src}")" ln -s "$src" "$HOME/test/$(basename "${src}")" done +for initialFolder in "$DOTFILES_CONFIG" "$DOTFILES_ICONS" "$DOTFILES_SSH"; do + for src in $(find -H "$initialFolder"); do + if [[ -d "$src" ]]; then + var=$(echo "$src" | awk '{ sub(/.*CocoRice\//, ""); print }') -for src in $(find -H "$DOTFILES_CONFIG"); do - if [[ -d "$src" ]]; then - var=$(echo "$src" | awk '{ sub(/.*CocoRice\//, ""); print }') - if [[ ! -d "$HOME/test/$var" ]]; then - echo "$HOME/test/$var" "doesn't exists" - mkdir -p "$HOME/test/$var" - fi - fi + if [[ ! -d "$HOME/test/$var" ]]; then + echo "$HOME/test/$var" "doesn't exists" + mkdir -p "$HOME/test/$var" + fi + fi - if [[ -f "$src" ]]; then - #awk '{ sub(/.*CocoRice\//, ""); print }' <<< "$src" - var=$(echo "$src" | awk '{ sub(/.*CocoRice\//, ""); print }') - ln -s "$src" "$HOME/test/$var" - fi -done + if [[ -f "$src" ]]; then + var=$(echo "$src" | awk '{ sub(/.*CocoRice\//, ""); print }') + ln -s "$src" "$HOME/test/$var" + fi + done +done \ No newline at end of file