Loading improvements
.bashrc will skip .swp files (editors leave those while open) bin.path renamed to path.env and PATH manipulation should be 'cleaner' it adds required dirs to paths, but also makes sure no duplicates are inserted. chezmoi logic split, and status is seperated from aliases. Disable chezmoi status on load, as it is SLOW.
This commit is contained in:
parent
ce4d8c303d
commit
7c17b8922c
6 changed files with 24 additions and 14 deletions
18
_home/dot_sz.shrc.d/10_path.env
Normal file
18
_home/dot_sz.shrc.d/10_path.env
Normal file
|
@ -0,0 +1,18 @@
|
|||
get_clean_path() {
|
||||
sed 's/ *:\?$//g;s/`/``/g;s/:/`:`/g;s/\\`:`/\\:/g;' <<< $1 | \
|
||||
awk -v RS='`:`' -v ORS='`:`' '!arr[$0]++' | \
|
||||
sed 's/`:`/:/g;s/:$//g'
|
||||
}
|
||||
|
||||
# set PATH so it includes user's private bin if it exists
|
||||
if [[ -d "$HOME/bin" ]] ; then
|
||||
export PATH="$HOME/bin:$PATH"
|
||||
fi
|
||||
|
||||
# set PATH so it includes user's private bin if it exists
|
||||
if [[ -d "$HOME/.local/bin" ]] ; then
|
||||
export PATH="$HOME/.local/bin:$PATH"
|
||||
fi
|
||||
|
||||
PATH=$( get_clean_path $PATH )
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue