prepare for symclone.

From now on, _src.posix will be the single source of truth.
And _home(.*) will symlink into it.
This commit is contained in:
Lockszmith (@VAST) 2025-02-20 23:34:24 -05:00
parent 5e26df3f9b
commit 44b03e8724
47 changed files with 58 additions and 0 deletions

View file

@ -0,0 +1,15 @@
#!/usr/bin/env -S sh -c 'echo "Not a user script. source(aka .) only"'
# Remove duplicates from PATH
OLDPATH="$PATH"; NEWPATH=""; colon=""
while [ "${OLDPATH#*:}" != "$OLDPATH" ]; do
entry="${OLDPATH%%:*}"; search=":${OLDPATH#*:}:"
[ "${search#*:"$entry":}" = "$search" ] && [[ -d $entry ]] && NEWPATH="$NEWPATH$colon$entry" && colon=:
OLDPATH="${OLDPATH#*:}"
done
NEWPATH="$NEWPATH:$OLDPATH"
export PATH="$NEWPATH"
unset NEWPATH OLDPATH colon entry search
[[ -n "${DBG}" ]] && echo "${PATH//:/\n}"