diff options
| author | srdusr <trevorgray@srdusr.com> | 2025-10-01 17:21:05 +0200 |
|---|---|---|
| committer | srdusr <trevorgray@srdusr.com> | 2025-10-01 17:21:05 +0200 |
| commit | afe53c73bfd21a2931afccae9ea0bcfbfd4a9405 (patch) | |
| tree | ad83f1a6da18ed04808040ce1eff4b7d878d1ede /linux/home/.scripts/dotfiles.sh | |
| parent | a1c6c0e20541575e57660d771b8a948d558648d1 (diff) | |
| download | dotfiles-afe53c73bfd21a2931afccae9ea0bcfbfd4a9405.tar.gz dotfiles-afe53c73bfd21a2931afccae9ea0bcfbfd4a9405.zip | |
Testing updated dir structures
Diffstat (limited to 'linux/home/.scripts/dotfiles.sh')
| -rwxr-xr-x | linux/home/.scripts/dotfiles.sh | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/linux/home/.scripts/dotfiles.sh b/linux/home/.scripts/dotfiles.sh deleted file mode 100755 index b231367..0000000 --- a/linux/home/.scripts/dotfiles.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash - -# Set the bare dotfiles repo directory -dotfiles_dir="$HOME/.cfg" - -# Set the home directory -home_dir="$HOME" - -# Exclude the .cfg directory and any other files/directories you want to ignore -exclude_list=(".cfg") - -# Change to the home directory -cd "$home_dir" - -# Get a list of all dotfiles in the repository -files=$(find "$dotfiles_dir" -maxdepth 1 -type f -not -name ".*" -not -name "${exclude_list[*]}" -printf "%f\n") - -# Link each file to its corresponding location in $HOME -for file in $files; do - ln -sf "$dotfiles_dir/$file" "$home_dir/.$file" -done - -# Get a list of all dot directories in the repository -dirs=$(find "$dotfiles_dir" -maxdepth 1 -type d -not -path "$dotfiles_dir" -not -name ".*" -not -name "${exclude_list[*]}" -printf "%f\n") - -# Link each directory to its corresponding location in $HOME -for dir in $dirs; do - ln -sf "$dotfiles_dir/$dir" "$home_dir/.$dir" -done - -# Remove any symlinks that are no longer present in the repo -while IFS= read -r -d '' link; do - if [[ ! -e "$link" ]]; then - rm "$link" - fi -done < <(find "$home_dir" -maxdepth 1 -type l -name ".*" -not -name ".cfg" -print0) - |
