zexists changes
This commit is contained in:
parent
570390e192
commit
f58f9a723b
9 changed files with 14 additions and 21 deletions
|
@ -1,13 +0,0 @@
|
|||
##? envsubst - fall-back wrapper in the event the envsubst command does not exist.
|
||||
|
||||
if (( ! $+commands[envsubst] )); then
|
||||
function envsubst {
|
||||
command envsubst "$@"
|
||||
}
|
||||
else
|
||||
function envsubst {
|
||||
python -c 'import os,sys;[sys.stdout.write(os.path.expandvars(l)) for l in sys.stdin]'
|
||||
}
|
||||
fi
|
||||
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
|
@ -1,3 +1,5 @@
|
|||
#!/usr/bin/env zsh
|
||||
|
||||
function source-zshcmdd {
|
||||
setopt extended_glob
|
||||
|
||||
|
@ -35,15 +37,13 @@ function source-zshcmdd {
|
|||
source-zshcmdd
|
||||
|
||||
function zshdir-decode {
|
||||
# echo ${${1//--DOLLAR--/$}//--SLASH--/\/} | envsubst
|
||||
# for now just remove the 'dir' part
|
||||
# :3 for 'dir'
|
||||
echo ${${1//-DOLLAR-/$}//-SLASH-/\/} | envsubst
|
||||
echo ${${1//-SLASH-//}/-DOT-/\.}
|
||||
}
|
||||
|
||||
function zshdir-encode {
|
||||
# dir is hardcoded...
|
||||
echo dir${${1//${HOME}/\-DOLLAR-HOME}//\//-SLASH-}
|
||||
echo dir${${1//${HOME}\//}//\//-SLASH-}
|
||||
}
|
||||
|
||||
|
||||
|
@ -82,12 +82,11 @@ function source-zshpathd {
|
|||
return 1
|
||||
fi
|
||||
|
||||
|
||||
# ignore files that begin with a tilde
|
||||
case ${rcfile:t} in '~'*) continue;; esac
|
||||
# remove 'dir' from name
|
||||
name=${${rcfile:t}/$pathtype/}
|
||||
directory=$(zshdir-decode ${name})
|
||||
name=${${rcfile:t}/${pathtype}-/}
|
||||
directory=$HOME/$(zshdir-decode ${name})
|
||||
# source files only if exe with that name exists
|
||||
if [[ -d $directory ]]; then
|
||||
source $rcfile
|
||||
|
@ -101,3 +100,4 @@ function source-zshpathd {
|
|||
|
||||
source-zshpathd
|
||||
|
||||
unset _envsubst
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
#!/usr/bin/env zsh
|
||||
|
||||
function envsubst {
|
||||
python -c 'import os,sys;[sys.stdout.write(os.path.expandvars(l)) for l in sys.stdin]'
|
||||
}
|
||||
|
|
@ -3,6 +3,6 @@ alias t-labbook="$DOTFILES_DIR/tmux/labbook.sh"
|
|||
alias tmux="tmux -f $HOME/.config/tmux/tmux.conf"
|
||||
alias t='tmux'
|
||||
alias ta='tmux attach -t'
|
||||
alias tn='tmux new-session'
|
||||
alias tn='tmux new-session -s'
|
||||
alias tl='tmux list-sessions'
|
||||
|
||||
|
|
Loading…
Reference in a new issue