config: update ignoredirs

This commit is contained in:
xeruf 2021-11-11 20:46:39 +01:00
parent 61b37ec463
commit 831cfcc4e7
6 changed files with 9 additions and 8 deletions

View File

@ -188,7 +188,7 @@ alias mdox="xclip -o -selection clipboard | mdo | xclip -filter"
alias gdiff='git diff --word-diff=color --word-diff-regex=. --no-index' alias gdiff='git diff --word-diff=color --word-diff-regex=. --no-index'
alias grp='grep --color=auto --line-number --ignore-case --binary-files=without-match --directories=skip' alias grp='grep --color=auto --line-number --ignore-case --binary-files=without-match --directories=skip'
grpr() { grp --color=always --recursive $(echo $IGNOREDIRS | sed 's/-x/--exclude-dir/g') "$@" | less -F } grpr() { grp --color=always --recursive $(echo $DIRS_IGNORE | sed 's/-x/--exclude-dir/g') "$@" | less -F }
# Recover stray swap files from neovim # Recover stray swap files from neovim
alias vrec="ls $XDG_DATA_HOME/nvim/swap | sed 's/\%/\//g' | sed 's|\(.*\)\..*|\1|' | head -1 | xargs -r nvim" alias vrec="ls $XDG_DATA_HOME/nvim/swap | sed 's/\%/\//g' | sed 's|\(.*\)\..*|\1|' | head -1 | xargs -r nvim"

View File

@ -7,5 +7,5 @@ esac
name="/mnt/backup/borg::$(test -n "$name" && echo "$name" || cat /etc/hostname)-${1:-system}-$(date -u +"%y%m%d")" name="/mnt/backup/borg::$(test -n "$name" && echo "$name" || cat /etc/hostname)-${1:-system}-$(date -u +"%y%m%d")"
echo "Backing up as $name" echo "Backing up as $name"
sudo borg create --progress --stats \ sudo borg create --progress --stats \
$(echo $IGNOREDIRS_PURE -x 'software-challenge/*/build' -x 'emacs/.local' | sed 's|-x \([^ ]\+\)|-e "*/\1" -e \1|g') \ $(echo $DIRS_IGNORE_SAFE -x 'software-challenge/*/build' -x 'emacs/.local' | sed 's|-x \([^ ]\+\)|-e "*/\1" -e \1|g') \
"$name" $(test $# -eq 0 && echo etc home root || test $# -eq 1 && echo $1) "${@:2}" "$name" $(test $# -eq 0 && echo etc home root || test $# -eq 1 && echo $1) "${@:2}"

View File

@ -45,8 +45,8 @@ fi
highlight "d to recursively remove development caches" highlight "d to recursively remove development caches"
if [[ $1 =~ "d" ]]; then if [[ $1 =~ "d" ]]; then
rm -rf .npm .yarn rm -rf .npm .yarn
find -name "src" -prune -o \ arg-test -name "src" -prune -o \
-type d \( -name ".gradle" -o -name "generated" -o -name "dist-newstyle" -o -name "cache" -o -name "node_modules" -o -name "cmake_build" \) \ -type d \( -name 'cache' $(echo $DIRS_GENERATED | sed 's|-x \([^ ]\+\)|-o -name "\1"|g') \
-print -exec rm -r {} + -prune -print -exec rm -r {} + -prune
echo -n " " && highlight "build directories" echo -n " " && highlight "build directories"
find $DATA/2-standards/dev/aur -mindepth 2 -maxdepth 2 -type d -not -name ".*" \ find $DATA/2-standards/dev/aur -mindepth 2 -maxdepth 2 -type d -not -name ".*" \

View File

@ -1,3 +1,3 @@
#!/bin/sh #!/bin/sh
# Diff project directories, excluding any generated content # Diff project directories, excluding any generated content
diff-color -r $IGNOREDIRS "$@" | less -F diff-color -r $DIRS_IGNORE "$@" | less -F

View File

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
# Use grep and sed to replace $1 with $2 recursively and print what is done # Use grep and sed to replace $1 with $2 recursively and print what is done
grep --null --recursive --files-with-matches \ grep --null --recursive --files-with-matches \
--binary-files=without-match "--exclude-dir={$IGNOREDIRS}" "$1" | --binary-files=without-match "--exclude-dir={$DIRS_IGNORE}" "$1" |
xargs -0 sed -i "\|${1}|{ xargs -0 sed -i "\|${1}|{
s||${2}|g s||${2}|g
w /dev/stdout w /dev/stdout

View File

@ -57,8 +57,9 @@ export CONFIG_SHELLS="$XDG_CONFIG_HOME/shell"
# environment # environment
which nvim >/dev/null && export EDITOR='nvim' || export EDITOR='vim' which nvim >/dev/null && export EDITOR='nvim' || export EDITOR='vim'
export LESS="--RAW-CONTROL-CHARS --ignore-case --LONG-PROMPT --jump-target=5 $(test $(less --version | head -1 | cut -f2 -d' ') -ge 590 && echo --incsearch)" export LESS="--RAW-CONTROL-CHARS --ignore-case --LONG-PROMPT --jump-target=5 $(test $(less --version | head -1 | cut -f2 -d' ') -ge 590 && echo --incsearch)"
export IGNOREDIRS_PURE="-x .sync -x .stfolder -x .gradle -x dist_newstyle -x node_modules -x generated -x .cache -x *Cache -x .local/cache -x .local/state -x share/JetBrains -x share/Zeal -x share/syncthing -x .cpan -x .cpanm -x __pycache__" export DIRS_GENERATED="-x generated -x .gradle -x cmake_build -x dist-newstyle -x node_modules -x __pycache__"
export IGNOREDIRS="-x *build -x .git -x .idea -x out -x cache -x Partitions $IGNOREDIRS_PURE" export DIRS_IGNORE_SAFE="-x .sync -x .stfolder -x .cache -x *Cache -x .local/cache -x .local/state -x share/JetBrains -x share/Zeal -x share/syncthing -x .cpan -x .cpanm $DIRS_GENERATED"
export DIRS_IGNORE="-x *build -x .git -x .idea -x out -x cache -x Partitions $DIRS_IGNORE_SAFE"
# red stderr # red stderr
test -f "/usr/lib/libstderred.so" && export LD_PRELOAD="/usr/lib/libstderred.so${LD_PRELOAD:+:$LD_PRELOAD}" test -f "/usr/lib/libstderred.so" && export LD_PRELOAD="/usr/lib/libstderred.so${LD_PRELOAD:+:$LD_PRELOAD}"
# software config # software config