v2.6.0
===================================================================== --- New Scripts -------------------------- - i3 window manager scrypts (see --help for more info) - zsh/i3/create-local-font-override - zsh/i3/launch-or-show --- New Features ------------------------- Now support `__select` syntax in environment files! (see zsh/scwrypts/README.md for more detail) --- Changes ------------------------------ - moved some rogue configuration files under the scwrypts config - ~/.vim/bundle/build.zsh >> ~/.config/scwrypts/vundle.zsh - ~/.config/scwrypts/config.dotfile.zsh >> ~/.config/scwrypts/dotfiles.zsh - __FZF, __FZF_TAIL, and __FZF_HEAD now create prompt+response logs --- Bug Fixes ---------------------------- - zsh/config/symlinks - don't fail when trying to symlink a directory - no longer fails when trying to replace a broken symlink - scwrypts now detects environments which are symlinked - USAGE syntax now correctly shows the position of the '--' argument delimiter support __select in env files; ignore __lower_case suffix in env files; put blank line before comments in env files added i3 scripts
This commit is contained in:
@ -17,10 +17,12 @@ _SYNCHRONIZE() {
|
||||
|
||||
[ ! $SLIENT ] && {
|
||||
__yN 'change the template before sync?' && __EDIT $__ENV_TEMPLATE
|
||||
_SORT_ENV "$__ENV_TEMPLATE"
|
||||
git add $__ENV_TEMPLATE >/dev/null 2>&1
|
||||
}
|
||||
|
||||
_SORT_ENV "$__ENV_TEMPLATE"
|
||||
sed -i '/__[a-z_]\+=$/d' "$__ENV_TEMPLATE"
|
||||
git add $__ENV_TEMPLATE >/dev/null 2>&1
|
||||
|
||||
ENVIRONMENTS=$(__GET_ENV_NAMES | sort -r)
|
||||
|
||||
_CLEAR_INHERITED_VARIABLES
|
||||
@ -68,6 +70,8 @@ _REMOVE_OLD_VARIABLES() {
|
||||
while read line
|
||||
do
|
||||
ENV_VAR=$(echo "$line" | sed 's/=.*/=/')
|
||||
echo $ENV_VAR | grep -q '__[a-z_]\+=' && continue
|
||||
|
||||
grep -q "$ENV_VAR" "$__ENV_TEMPLATE" || {
|
||||
sed -i "\\%$ENV_VAR%d" "$ENV_FILE"
|
||||
echo "$ENV_VAR" | grep -qv '^#' \
|
||||
@ -139,14 +143,11 @@ _ADD_DESCRIPTIONS() {
|
||||
done
|
||||
done < <(sed -n '/^[^ ]\+ \+| /p' "$__ENV_TEMPLATE.descriptions")
|
||||
|
||||
while read ENV_VAR
|
||||
for ENV_NAME in $(echo $ENVIRONMENTS)
|
||||
do
|
||||
for ENV_NAME in $(echo $ENVIRONMENTS)
|
||||
do
|
||||
sed -i "/^export $ENV_VAR=/a \ " "$(__GET_ENV_FILE $ENV_NAME)"
|
||||
sed -i "s/^ $//" "$(__GET_ENV_FILE $ENV_NAME)"
|
||||
done
|
||||
done < <(grep -B1 '^$' "$__ENV_TEMPLATE.descriptions" | grep '|' | awk '{print $1;}')
|
||||
sed -i "/^# /i \ " "$(__GET_ENV_FILE $ENV_NAME)"
|
||||
sed -i "s/^ $//" "$(__GET_ENV_FILE $ENV_NAME)"
|
||||
done
|
||||
}
|
||||
|
||||
#####################################################################
|
||||
|
Reference in New Issue
Block a user