mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-11-22 04:10:07 +00:00
Merge commit 'c8160f29543a2f57ae7149103deefa029fd4e861'
This commit is contained in:
commit
2079d8ecbe
2 changed files with 29 additions and 3 deletions
|
@ -12,11 +12,24 @@ fi
|
||||||
export LC_ALL=C
|
export LC_ALL=C
|
||||||
|
|
||||||
if [ -z "${ZSH_VERSION-}" ] && command -v zsh >/dev/null 2>&1; then
|
if [ -z "${ZSH_VERSION-}" ] && command -v zsh >/dev/null 2>&1; then
|
||||||
|
# Avoid bash 3.*.
|
||||||
case "${BASH_VERSION-}" in
|
case "${BASH_VERSION-}" in
|
||||||
[0-3].*) exec zsh "$0" "$@";;
|
[0-3].*) exec zsh "$0" "$@";;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Avoid ksh: https://github.com/romkatv/gitstatus/issues/282.
|
||||||
|
if [ -n "${KSH_VERSION-}" ]; then
|
||||||
|
if [ -z "${ZSH_VERSION-}" ] && command -v zsh >/dev/null 2>&1; then
|
||||||
|
exec zsh "$0" "$@"
|
||||||
|
elif [ -z "${BASH_VERSION-}" ] && command -v bash >/dev/null 2>&1 &&
|
||||||
|
bash_version="$(bash --version 2>&1)"; then
|
||||||
|
case "$bash_version" in
|
||||||
|
*version\ [4-9]*|*version\ [1-9][0-9]*) exec bash "$0" "$@";;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
usage="$(command cat <<\END
|
usage="$(command cat <<\END
|
||||||
Usage: build [-m ARCH] [-c CPU] [-d CMD] [-i IMAGE] [-s] [-w]
|
Usage: build [-m ARCH] [-c CPU] [-d CMD] [-i IMAGE] [-s] [-w]
|
||||||
|
|
||||||
|
@ -91,7 +104,7 @@ if [ -n "$gitstatus_install_tools" ]; then
|
||||||
command pkg install -y cmake gmake binutils git perl5 wget
|
command pkg install -y cmake gmake binutils git perl5 wget
|
||||||
;;
|
;;
|
||||||
openbsd)
|
openbsd)
|
||||||
command pkg_add install cmake gmake gcc git wget
|
command pkg_add cmake gmake gcc g++ git wget
|
||||||
;;
|
;;
|
||||||
netbsd)
|
netbsd)
|
||||||
command pkgin -y install cmake gmake binutils git
|
command pkgin -y install cmake gmake binutils git
|
||||||
|
@ -509,6 +522,7 @@ if [ -z "$gitstatus_cpu" ]; then
|
||||||
arm64|aarch64) gitstatus_cpu=armv8-a;;
|
arm64|aarch64) gitstatus_cpu=armv8-a;;
|
||||||
ppc64le) gitstatus_cpu=powerpc64le;;
|
ppc64le) gitstatus_cpu=powerpc64le;;
|
||||||
riscv64) gitstatus_cpu=rv64imafdc;;
|
riscv64) gitstatus_cpu=rv64imafdc;;
|
||||||
|
loongarch64) gitstatus_cpu=loongarch64;;
|
||||||
x86_64|amd64) gitstatus_cpu=x86-64;;
|
x86_64|amd64) gitstatus_cpu=x86-64;;
|
||||||
x86) gitstatus_cpu=i586;;
|
x86) gitstatus_cpu=i586;;
|
||||||
s390x) gitstatus_cpu=z900;;
|
s390x) gitstatus_cpu=z900;;
|
||||||
|
|
|
@ -185,9 +185,21 @@ function gitstatus_query"${1:-}"() {
|
||||||
(( _GITSTATUS_STATE_$name == 2 )) || return
|
(( _GITSTATUS_STATE_$name == 2 )) || return
|
||||||
|
|
||||||
if [[ -z $GIT_DIR ]]; then
|
if [[ -z $GIT_DIR ]]; then
|
||||||
[[ $dir == /* ]] || dir=${(%):-%/}/$dir
|
if [[ $dir != /* ]]; then
|
||||||
|
if [[ $PWD == /* && $PWD -ef . ]]; then
|
||||||
|
dir=$PWD/$dir
|
||||||
|
else
|
||||||
|
dir=${dir:a}
|
||||||
|
fi
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
[[ $GIT_DIR == /* ]] && dir=:$GIT_DIR || dir=:${(%):-%/}/$GIT_DIR
|
if [[ $GIT_DIR == /* ]]; then
|
||||||
|
dir=:$GIT_DIR
|
||||||
|
elif [[ $PWD == /* && $PWD -ef . ]]; then
|
||||||
|
dir=:$PWD/$GIT_DIR
|
||||||
|
else
|
||||||
|
dir=:${GIT_DIR:a}
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $dir != (|:)/* ]]; then
|
if [[ $dir != (|:)/* ]]; then
|
||||||
|
|
Loading…
Reference in a new issue