mirror of
https://github.com/elkowar/dots-of-war.git
synced 2024-11-06 03:12:24 +00:00
14 lines
439 B
Bash
14 lines
439 B
Bash
# Function to determine the need of a zcompile. If the .zwc file
|
|
# does not exist, or the base file is newer, we need to compile.
|
|
# These jobs are asynchronous, and will not impact the interactive shell
|
|
zcompare() {
|
|
if [[ -s ${1} && ( ! -s ${1}.zwc || ${1} -nt ${1}.zwc) ]]; then
|
|
zcompile ${1}
|
|
fi
|
|
}
|
|
|
|
emulate zsh -o extended_glob -c "local files=($ZDOTDIR/*.zsh)"
|
|
for file in "${files[@]}"; do
|
|
zcompare $file
|
|
done
|
|
zcompare .zshrc
|