mirror of
https://github.com/DictXiong/dotfiles.git
synced 2024-11-24 06:27:03 +08:00
zshrc: fix locale (#34)
* common.sh: export vars in env; zshrc: gdebug * fix error when locale not exists * fix ci Co-authored-by: xiongdian.me <xiongdian.me@bytedance.com>
This commit is contained in:
parent
c3e0c28b64
commit
952bfabea4
3
.zshrc2
3
.zshrc2
|
@ -1,6 +1,6 @@
|
|||
# env for shell
|
||||
export TERM="xterm-256color"
|
||||
if ( locale -a | grep -qxE "C.UTF-8|C.utf8" ); then
|
||||
if (command -v locale >/dev/null) && ( locale -a | grep -qxE "C.UTF-8|C.utf8" ); then
|
||||
export LC_ALL=C.UTF-8
|
||||
export LANG=C.UTF-8
|
||||
else
|
||||
|
@ -100,6 +100,7 @@ alias "se"='sudo -sE'
|
|||
alias "pbd"='ping baidu.com'
|
||||
alias "p114"='ping 114.114.114.114'
|
||||
alias "p666"='ping6 2001:da8::666'
|
||||
alias "gdebug"='git add -A; git commit -m "bug fix"'
|
||||
case $(bash "$DOTFILES/tools/common.sh" get_os_type) in
|
||||
macos ) alias l='ls -lAGh -D "%y-%m-%d %H:%M"' ;;
|
||||
* ) alias l='ls -lAGh --time-style="+%y-%m-%d %H:%M"' ;;
|
||||
|
|
|
@ -206,11 +206,16 @@ install_update()
|
|||
cp "${DOTFILES}/.update.sh" "${DOTFILES}/update.sh"
|
||||
chmod +x "${DOTFILES}/update.sh"
|
||||
fmt_note "running update.sh ..."
|
||||
set +e
|
||||
DFS_UPDATED_RET=85 ${DOTFILES}/update.sh
|
||||
if [[ $? == 85 ]]; then
|
||||
RET=$?
|
||||
if [[ $RET == 85 ]]; then
|
||||
fmt_note "dfs updated. re-running install.sh ..."
|
||||
"${DOTFILES}/install.sh" "$ORIGIN_ARGS" && exit
|
||||
elif [[ $RET != 0 ]]; then
|
||||
fmt_fatal "update.sh failed with exit code $RET"
|
||||
fi
|
||||
set -e
|
||||
}
|
||||
|
||||
uninstall_update()
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
THIS_DIR_COMMON_SH=$( cd "$( dirname "${BASH_SOURCE[0]:-${(%):-%x}}" )" && pwd )
|
||||
export DOTFILES=$( cd "$THIS_DIR_COMMON_SH/.." && pwd )
|
||||
if [[ -f ~/.config/dotfiles/env ]]; then source ~/.config/dotfiles/env; fi
|
||||
if [[ -f ~/.config/dotfiles/env ]]; then set -a; source ~/.config/dotfiles/env; set +a; fi
|
||||
|
||||
# Color settings
|
||||
# Source: https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh
|
||||
|
|
Loading…
Reference in New Issue
Block a user