#!/bin/sh
#
# AX-ZSH: Alex' Modular ZSH Configuration
-# Copyright (c) 2015 Alexander Barton <alex@barton.de>
+# Copyright (c) 2015-2022 Alexander Barton <alex@barton.de>
#
# Include "ax-common.sh":
umask 027
-[ -n "$AXZSH" ] || AXZSH="$HOME/.axzsh"
+[ -n "$AXZSH" ] || AXZSH="${ZDOTDIR:-$HOME}/.axzsh"
export AXZSH
S=$(dirname "$0")
ax_msg - "Linking ZSH startup files ..."
-for f in ~/.zlogin ~/.zlogout ~/.zprofile ~/.zshrc; do
+for f in \
+ ${ZDOTDIR:-$HOME}/.zlogin \
+ ${ZDOTDIR:-$HOME}/.zlogout \
+ ${ZDOTDIR:-$HOME}/.zprofile \
+ ${ZDOTDIR:-$HOME}/.zshrc \
+; do
safe_rm "$f" || abort
ln -sv "$AXZSH/ax.zsh" "$f" || abort
done
zsh "$AXZSH/bin/axzshctl" reset-plugins || abort
else
ax_msg 1 "Oops, \"zsh\" not found!?"
+ exit 1
fi
else
ax_msg - "Plugin directory \"$AXZSH/active_plugins\" already exists. Ok."