=align _home with symlinks and new features
This commit is contained in:
parent
14e5c0174c
commit
95964b4024
|
@ -1 +0,0 @@
|
|||
../_src.posix/.chezmoiexternal.yaml
|
|
@ -0,0 +1 @@
|
|||
../_src.posix/.chezmoiexternal.yaml.tmpl
|
|
@ -0,0 +1 @@
|
|||
../_src.posix/dot_vimrc
|
|
@ -0,0 +1 @@
|
|||
../../../_src.posix/private_dot_config/sz.env/.aliases.macos.env
|
|
@ -1 +0,0 @@
|
|||
../../../_src.posix/private_dot_config/sz.env/000_stop_on_non_interactive_sessions.env
|
|
@ -0,0 +1 @@
|
|||
../../../_src.posix/private_dot_config/sz.env/099_stop_on_non_interactive_sessions.env
|
|
@ -1 +0,0 @@
|
|||
../../../_src.posix/private_dot_config/sz.env/aaa_zsh_0_perp.env
|
|
@ -0,0 +1 @@
|
|||
../../../_src.posix/private_dot_config/sz.env/aaa_zsh_0_perp.env.zsh
|
|
@ -1 +0,0 @@
|
|||
../../../_src.posix/private_dot_config/sz.env/aaa_zsh_2_zinit.env
|
|
@ -0,0 +1 @@
|
|||
../../../_src.posix/private_dot_config/sz.env/aaa_zsh_2_zinit.env.zsh
|
|
@ -1 +0,0 @@
|
|||
../../../_src.posix/private_dot_config/sz.env/aaa_zsh_3_completion_system.env
|
|
@ -0,0 +1 @@
|
|||
../../../_src.posix/private_dot_config/sz.env/aaa_zsh_3_completion_system.env.zsh
|
|
@ -1 +0,0 @@
|
|||
../../../_src.posix/private_dot_config/sz.env/aliases.env
|
|
@ -0,0 +1 @@
|
|||
../../../_src.posix/private_dot_config/sz.env/aliases.env.tmpl
|
|
@ -1 +0,0 @@
|
|||
../../../_src.posix/private_dot_config/sz.env/bbb_bash_preexec.env
|
|
@ -0,0 +1 @@
|
|||
../../../_src.posix/private_dot_config/sz.env/bbb_bash_preexec.env.bash
|
|
@ -1 +0,0 @@
|
|||
../../../_src.posix/private_dot_config/sz.env/bbb_ble.sh.env
|
|
@ -0,0 +1 @@
|
|||
../../../_src.posix/private_dot_config/sz.env/bbb_ble.sh.env.bash
|
|
@ -1,94 +0,0 @@
|
|||
#! /usr/bin/env bash
|
||||
|
||||
# Helper function
|
||||
is_sourced() {
|
||||
if [ -n "$ZSH_VERSION" ]; then
|
||||
case $ZSH_EVAL_CONTEXT in *:file:*) return 0;; esac
|
||||
else # Add additional POSIX-compatible shell names here, if needed.
|
||||
case ${0##*/} in dash|-dash|bash|-bash|ksh|-ksh|sh|-sh) return 0;; esac
|
||||
fi
|
||||
return 1; # NOT sourced.
|
||||
}
|
||||
|
||||
BASE_0=${BASE_0:-$0}
|
||||
BASE_SHELL=$(basename "$SHELL")
|
||||
|
||||
is_cmd() {
|
||||
type -p -- "${@}" 2> /dev/null 1> /dev/null
|
||||
}
|
||||
|
||||
if is_sourced; then
|
||||
# shellcheck disable=SC2139 # This expands when defined, not when used.
|
||||
alias _r="unset DBG NO_RESET; exec $SHELL -l "
|
||||
# shellcheck disable=SC2139 # This expands when defined, not when used.
|
||||
alias _rdbg="exec sh -c 'DBG=1 NO_RESET=1 $SHELL -l '"
|
||||
|
||||
SZ_ENV_ROOT=$( cd -- "$( dirname -- "${BASE_0}" )" &> /dev/null && pwd )
|
||||
USER_HOME=$HOME
|
||||
[[ -n "${SUDO_USER}" ]] && USER_HOME="$(eval "echo ~${SUDO_USER}")"
|
||||
|
||||
load_next() {
|
||||
[ "$LOAD_EXIT" != "0" ] && return 1
|
||||
|
||||
if [[ -n "${DBG}" ]]; then
|
||||
DBG_TIME=$(date +%s%3N)
|
||||
echo "Loading ${1}..." 1>&2
|
||||
#shellcheck disable=SC2086
|
||||
${DBG/%1/:} 1>&2
|
||||
fi
|
||||
#shellcheck source=/dev/null
|
||||
. "${1}"
|
||||
if [[ -n "${DBG}" ]]; then
|
||||
DBG_TIME="$(($(date +%s%3N) - DBG_TIME ))"
|
||||
printf "%sms later. " "$DBG_TIME"
|
||||
fi
|
||||
}
|
||||
|
||||
load_all() {
|
||||
local ALL_ENV_FILES
|
||||
if [ -z "$SZ_ENV_LOADED" ]; then
|
||||
SZ_ENV_LOADED=1
|
||||
LOAD_EXIT=0
|
||||
|
||||
# The following constructs a list of load_next ... commands
|
||||
ALL_ENV_FILES="$(
|
||||
find ~/.config/sz.env -xdev -type d -not -name '*.off' \
|
||||
-exec sh -c '
|
||||
find "$1" -xdev -maxdepth 1 -type f -name "ID_*.env" | sort
|
||||
' shell '{}' ';' \
|
||||
-exec sh -c '
|
||||
find "$1" -xdev -maxdepth 1 -type f -name "PATH_*.env" | sort
|
||||
' shell '{}' ';' \
|
||||
-exec sh -c '
|
||||
find "$1" -xdev -maxdepth 1 -type f -name "*.env" -not -name "ID_*" -not -name "PATH_*" -print | sort
|
||||
' shell '{}' ';' \
|
||||
-exec sh -c '
|
||||
find "$1" -xdev -maxdepth 1 -type f -name "PATH_zz_cleanup.env"
|
||||
' shell '{}' ';' \
|
||||
| sed -e 's/^/load_next "/; s/$/";/'
|
||||
)"
|
||||
if [ -n "$DBG_NO_SZ_LOAD" ]; then
|
||||
ALL_ENV_FILES=$(<<<"$ALL_ENV_FILES" sed -Ee '
|
||||
/PATH_/!s/^(load_next )/# \1/
|
||||
')
|
||||
printf 'Loading limited environment...\n'
|
||||
fi
|
||||
# Run the constructed (see above) list
|
||||
eval "$ALL_ENV_FILES"
|
||||
fi
|
||||
}
|
||||
load_all
|
||||
elif [[ "$1" == '-' ]]; then
|
||||
echo "BASE_0=${BASE_0}"
|
||||
cat "${0}"
|
||||
else
|
||||
is_cmd "${BASE_0##*/}" && SCRIPT_NAME="${BASE_0##*/}" || SCRIPT_NAME="${BASE_0/$HOME/\~}"
|
||||
printf '%s\n' \
|
||||
"It seems '$SCRIPT_NAME' was invoked as a standalone script." \
|
||||
'This script is designed to produce output that is sourced.' \
|
||||
'' \
|
||||
'The recommended way is to use calling pattern below:' \
|
||||
" $ . <( $SCRIPT_NAME - ) # Note the '-' after the script's name" \
|
||||
''
|
||||
fi
|
||||
|
|
@ -0,0 +1 @@
|
|||
../../../_src.posix/private_dot_config/sz.env/executable__.load.sh
|
|
@ -0,0 +1 @@
|
|||
../../../_src.posix/private_dot_config/sz.env/remove_000_stop_on_non_interactive_sessions.env
|
|
@ -0,0 +1 @@
|
|||
../../../_src.posix/private_dot_config/sz.env/remove_aaa_zsh_0_perp.env
|
|
@ -0,0 +1 @@
|
|||
../../../_src.posix/private_dot_config/sz.env/remove_aaa_zsh_2_zinit.env
|
|
@ -0,0 +1 @@
|
|||
../../../_src.posix/private_dot_config/sz.env/remove_aaa_zsh_3_completion_system.env
|
|
@ -0,0 +1 @@
|
|||
../../../_src.posix/private_dot_config/sz.env/remove_bbb_bash_preexec.env
|
|
@ -0,0 +1 @@
|
|||
../../../_src.posix/private_dot_config/sz.env/remove_bbb_ble.sh.env
|
|
@ -0,0 +1 @@
|
|||
../../../_src.posix/private_dot_config/sz.env/zzz_teleport.env
|
|
@ -0,0 +1 @@
|
|||
../../../_src.posix/private_dot_config/vim/_init
|
|
@ -0,0 +1 @@
|
|||
../../../_src.posix/private_dot_local/bin/.keep
|
|
@ -0,0 +1 @@
|
|||
../../../_src.posix/private_dot_local/bin/executable_tsh-get
|
|
@ -0,0 +1 @@
|
|||
../../../_src.posix/private_dot_local/bin/executable_tssh
|
|
@ -0,0 +1 @@
|
|||
../../../_src.posix/private_dot_local/bin/executable_tssh-with-tunnel
|
|
@ -0,0 +1 @@
|
|||
../../../_src.posix/private_dot_local/bin/symlink_nvim
|
|
@ -0,0 +1 @@
|
|||
../../../_src.posix/private_dot_local/bin/symlink_vi
|
|
@ -0,0 +1 @@
|
|||
../../../_src.posix/private_dot_local/bin/symlink_vim
|
|
@ -0,0 +1 @@
|
|||
../../../_src.posix/private_dot_local/bin/symlink_vim.tiny
|
|
@ -0,0 +1 @@
|
|||
../../../_src.posix/private_dot_local/bin/symlink_vimdiff
|
|
@ -0,0 +1 @@
|
|||
../../../_src.posix/private_dot_ssh/config.d/.keep
|
Loading…
Reference in New Issue