foxshell/.zshenv

45 lines
1.6 KiB
Bash

# Documentation: https://git.foxdale.tech/Arctic/foxshell/blob/main/README.md.
#
# Do not modify this file unless you know exactly what you are doing.
# It is strongly recommended to keep all shell customization and configuration
# (including exported environment variables such as PATH) in ~/.zshrc or in
# files sourced from ~/.zshrc. If you are certain that you must export some
# environment variables in ~/.zshenv, do it where indicated by comments below.
if [ -n "${ZSH_VERSION-}" ]; then
# If you are certain that you must export some environment variables
# in ~/.zshenv (see comments at the top!), do it here:
#
# export GOPATH=$HOME/go
#
# Do not change anything else in this file.
: ${ZDOTDIR:=~}
setopt no_global_rcs
[[ -o no_interactive && -z "${FOXSHELL_BOOTSTRAPPING-}" ]] && return
setopt no_rcs
unset FOXSHELL_BOOTSTRAPPING
fi
FOXSHELL_URL="https://git.foxdale.tech/Arctic/foxshell/raw/branch/main"
: "${FOXSHELL:=${XDG_CACHE_HOME:-$HOME/.cache}/foxshell}"
umask o-w
if [ ! -e "$FOXSHELL"/foxshell.zsh ]; then
mkdir -p -- "$FOXSHELL" || return
>&2 printf '\033[33mfoxshell\033[0m: fetching \033[4mfoxshell.zsh\033[0m\n'
if command -v curl >/dev/null 2>&1; then
curl -fsSL -- "$FOXSHELL_URL"/foxshell.zsh >"$FOXSHELL"/foxshell.zsh.$$ || return
elif command -v wget >/dev/null 2>&1; then
wget -O- -- "$FOXSHELL_URL"/foxshell.zsh >"$FOXSHELL"/foxshell.zsh.$$ || return
else
>&2 printf '\033[33mfoxshell\033[0m: please install \033[32mcurl\033[0m or \033[32mwget\033[0m\n'
return 1
fi
mv -- "$FOXSHELL"/foxshell.zsh.$$ "$FOXSHELL"/foxshell.zsh || return
fi
. "$FOXSHELL"/foxshell.zsh || return
setopt rcs