2015-03-08 22:21:29 +05:00
|
|
|
# Configuration file loader.
|
|
|
|
if [ ! -d ${HOME}/.zsh-config.d/ ]; then
|
2015-12-26 22:16:17 +05:00
|
|
|
log 1 "Copying configuration to user's home directory..."
|
2015-03-21 20:30:55 +05:00
|
|
|
cp -R "${CONFIG_PATH}/zsh/defaults/" ${HOME}/.zsh-config.d
|
2015-03-08 22:21:29 +05:00
|
|
|
echo "Looks like it's a very first launch. So I've copied default config to '${HOME}/.zsh-config.d/'"
|
|
|
|
fi
|
|
|
|
|
2015-03-21 20:30:55 +05:00
|
|
|
for file in `find ${HOME}/.zsh-config.d/ -maxdepth 1 -type f -exec basename {} \; | sort`; do
|
2015-12-26 22:16:17 +05:00
|
|
|
log 1 "Loading configuration file: ${file}"
|
2015-03-21 20:30:55 +05:00
|
|
|
source "${HOME}/.zsh-config.d/${file}"
|
2015-03-21 19:52:26 +05:00
|
|
|
done
|
2015-12-26 22:16:17 +05:00
|
|
|
|
|
|
|
log 1 "Checking for configuration consistency..."
|
|
|
|
for file in `find ${CONFIG_PATH}/zsh/defaults/ -maxdepth 1 -type f -exec basename {} \; | sort`; do
|
|
|
|
if [ ! -f "${HOME}/.zsh-config.d/${file}" ]; then
|
|
|
|
cp "${CONFIG_PATH}/zsh/defaults/${file}" "${HOME}/.zsh-config.d/${file}"
|
|
|
|
log 0 "New configuration file '${file}' copied to your home directory (${HOME}/.zsh-config.d/)."
|
|
|
|
log 0 "Don't forget to take a look and configure, if neccessary!"
|
|
|
|
fi
|
|
|
|
done
|