소스 검색

Workaround for zsh users setting ZDOTDIR in ~/.zshenv who have no

~/.profile.
pull/638/head
Francesco Minnocci 3 년 전
부모
커밋
8f24eebb2a
1개의 변경된 파일5개의 추가작업 그리고 0개의 파일을 삭제
  1. +5
    -0
      bin/mailsync

+ 5
- 0
bin/mailsync 파일 보기

@@ -16,6 +16,11 @@ pgrep -u "${USER:=$LOGNAME}" >/dev/null || { echo "$USER not logged in; sync wil
# Run only if not already running in other instance
pgrep -x mbsync >/dev/null && { echo "mbsync is already running." ; exit ;}

# Workaround for zsh users who only have .zshenv in their $HOME.
usersh="$(awk -F: -v user="$USER" '$1 == user {print $NF}' /etc/passwd)"
[ "$usersh" = /usr/bin/zsh ] && eval "$(grep -h -- \
"^\s*\(export \)\?\(ZDOTDIR\|XDG_CONFIG_HOME\|XDG_DATA_HOME\)=" \
"$HOME/.zshenv" 2>/dev/null)"
# First, we have to get the right variables for the mbsync file, the pass
# archive, notmuch and the GPG home. This is done by searching common profile
# files for variable assignments. This is ugly, but there are few options that


불러오는 중...
취소
저장