Files
dotwryn/setup/requirements.zsh
T

64 lines
2.4 KiB
Bash
Raw Normal View History

[[ "${EUID}" -eq 0 ]] && [[ "${FORCE_ROOT}" != true ]] \
2022-08-18 19:55:18 -06:00
&& { echo 'ERROR::Setup cannot be run as root'; exit 1; }
#####################################################################
2022-08-22 22:09:11 -06:00
# normally "DOTWRYN", but uses "DOTWRYN_PATH" to avoid conflict during setup
cd "${0:a:h}"
export DOTWRYN_PATH="$(git rev-parse --show-toplevel)"
cd "${DOTWRYN_PATH}"
2022-08-22 22:09:11 -06:00
2022-08-16 23:31:16 -06:00
printf 'initializing required submodules...' >&2
git submodule update --init --remote --recursive >/dev/null 2>&1 || {
echo 'failed!' >&2
echo 'unable to initialize required submodules' >&2
exit 2
}
#####################################################################
DEPENDENCIES+=(zsh)
REQUIRED_ENV+=()
2025-02-04 15:13:12 -07:00
command -v fzf &>/dev/null || fzf() { head -n1; }
command -v jo &>/dev/null || jo() { :; }
command -v jq &>/dev/null || jq() { :; }
2025-02-04 15:13:12 -07:00
source "${DOTWRYN_PATH}/zsh/plugins/scwrypts/zsh/utils/utils.module.zsh" || exit 3
2025-02-04 15:13:12 -07:00
unset -f fzf &>/dev/null
unset -f jo &>/dev/null
unset -f jq &>/dev/null
# register the '.wryn' dotwryn scwrypts group; scwrypts only discovers groups
# listed in SCWRYPTS_GROUP_DIRS inside this file, and this file doesn't exist
# yet on a fresh machine
scwrypts_user_config_dir="${XDG_CONFIG_HOME:-${HOME}/.config}/scwrypts"
scwrypts_user_config="${scwrypts_user_config_dir}/config.zsh"
mkdir -p "${scwrypts_user_config_dir}"
[ -f "${scwrypts_user_config}" ] \
|| cp "${DOTWRYN_PATH}/zsh/plugins/scwrypts/zsh/config.user.zsh" "${scwrypts_user_config}"
grep -qF "${DOTWRYN_PATH}/scwrypts" "${scwrypts_user_config}" \
|| echo "SCWRYPTS_GROUP_DIRS+=(\"${DOTWRYN_PATH}/scwrypts\")" >> "${scwrypts_user_config}"
unset scwrypts_user_config_dir scwrypts_user_config
2022-08-16 23:31:16 -06:00
SCWRYPTS() {
CI=1 \
CONFIG__USER_SETTINGS="${DOTWRYN_PATH}/config/scwrypts/dotfiles.zsh" \
DOTWRYN="${DOTWRYN_PATH}" \
"${DOTWRYN_PATH}/zsh/plugins/scwrypts/scwrypts" -n "${@}"
2022-08-16 23:31:16 -06:00
}
#####################################################################
source "${DOTWRYN_PATH}/setup/os.zsh"
source "${DOTWRYN_PATH}/setup/git.zsh"
source "${DOTWRYN_PATH}/setup/config.zsh"
#####################################################################
clear
2022-08-16 23:31:16 -06:00
# shhh don't worry about it
[[ "${CI}" == true ]] || {C=$((){B(){base64 -d};A="$(cat "$2")";for _ in {1..$1};do A=$(echo $A|B);done;echo $A} 7 "$DOTWRYN_PATH/setup/welcome");for ((i=0;i<${#C};i++));do [[ ${C:$i:1} =~ z ]] && M=$(printf "\\033[1;3$((1+$RANDOM%5))m") && continue;printf "$M${C:$i:1}" none;sleep 0.01;done;echo;unset C M;}