Use find instead of ls.

This commit is contained in:
Stanislav Nikitin 2015-03-21 19:52:26 +05:00
parent 1be71ae671
commit eca7e5500a
4 changed files with 17 additions and 6 deletions

View File

@ -7,3 +7,12 @@ This is a ZSH configuration, baked by [Stanislav N. aka pztrn](http://en.pztrn.n
* Fully modular design. * Fully modular design.
* Ability to write own mini-apps. * Ability to write own mini-apps.
* Support libraries support. Just write them and place in 'lib'. Don't forget to source them! * Support libraries support. Just write them and place in 'lib'. Don't forget to source them!
* Same keyboard behaviour across OSes (tested on Linux and FreeBSD).
## Installation
Change your default shell to zsh and make a symlink:
ln -s /path/to/zsh-config/zshrc ~/.zshrc
Re-login (if you changed your shell) or just restart your terminal app.

View File

@ -5,6 +5,6 @@ if [ ! -d ${HOME}/.zsh-config.d/ ]; then
echo "Looks like it's a very first launch. So I've copied default config to '${HOME}/.zsh-config.d/'" echo "Looks like it's a very first launch. So I've copied default config to '${HOME}/.zsh-config.d/'"
fi fi
for file in `ls ${HOME}/.zsh-config.d/ | sort`; do for file in `find ${HOME}/.zsh-config.d/ -type f -depth 1 | sort`; do
source ${HOME}/.zsh-config.d/${file} source ${HOME}/.zsh-config.d/${file}
done done

View File

@ -1,9 +1,11 @@
for config_file in `ls ${CONFIG_PATH}/zsh/exports | sort`; do # Some default exports. They could be based on configuration variables.
for config_file in `find ${CONFIG_PATH}/zsh/exports -type f | sort`; do
source ${CONFIG_PATH}/zsh/exports/${config_file} source ${CONFIG_PATH}/zsh/exports/${config_file}
done done
# We should import user-specific exports and use them.
if [ -d ${HOME}/.zsh-config.d/exports ]; then if [ -d ${HOME}/.zsh-config.d/exports ]; then
for config_file in `ls ${HOME}/.zsh-config.d/exports | sort`; do for config_file in `find ${HOME}/.zsh-config.d/exports -type f | sort`; do
if [ -f ${HOME}/.zsh-config.d/exports/${config_file} ]; then if [ -f ${HOME}/.zsh-config.d/exports/${config_file} ]; then
source ${HOME}/.zsh-config.d/exports/${config_file} source ${HOME}/.zsh-config.d/exports/${config_file}
fi fi

View File

@ -7,12 +7,12 @@ alias screen="TERM=xterm screen"
alias clocksync="sudo ntpdate 0.pool.ntp.org" alias clocksync="sudo ntpdate 0.pool.ntp.org"
alias got="git" alias got="git"
for item in `ls ${CONFIG_PATH}/zsh/aliases`; do for item in `find ${CONFIG_PATH}/zsh/aliases -type f | sort`; do
source ${CONFIG_PATH}/zsh/aliases/${item} source ${CONFIG_PATH}/zsh/aliases/${item}
done done
if [ -d "${HOME}/.zsh-config.d/aliases" ]; then if [ -d "${HOME}/.zsh-config.d/aliases" ]; then
for item in `ls ${HOME}/.zsh-config.d/aliases`; do for item in `find ${HOME}/.zsh-config.d/aliases -type f | sort`; do
if [ -f ${HOME}/.zsh-config.d/aliases/${item} ]; then if [ -f ${HOME}/.zsh-config.d/aliases/${item} ]; then
source ${HOME}/.zsh-config.d/aliases/${item} source ${HOME}/.zsh-config.d/aliases/${item}
fi fi