Commit 5f907817 authored by Andrew Janke's avatar Andrew Janke
Browse files

plugins/chucknorris: Add automatic updating of the compiled fortune data file....

plugins/chucknorris: Add automatic updating of the compiled fortune data file. Use local variable for readability, and anonymous function to provide a scope for the local variable.
parent 9bf19603
if [ ! -f $ZSH/plugins/chucknorris/fortunes/chucknorris.dat ]; then () {
strfile $ZSH/plugins/chucknorris/fortunes/chucknorris $ZSH/plugins/chucknorris/fortunes/chucknorris.dat # Automatically generate or update Chuck's compiled fortune data file
fi local fdir=$ZSH/plugins/chucknorris/fortunes
if [[ ! -f $fdir/chucknorris.dat ]] || [[ $fdir/chucknorris.dat -ot $fdir/chucknorris ]]; then
strfile $fdir/chucknorris $fdir/chucknorris.dat
fi
# Aliases
alias chuck="fortune -a $fdir"
alias chuck_cow="chuck | cowthink"
}
alias chuck="fortune -a $ZSH/plugins/chucknorris/fortunes"
alias chuck_cow="chuck | cowthink"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment