mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-05 01:46:46 +01:00
Add mix-fast plugin (similar to rake-fast)
Signed-off-by: Mikhail S. Pobolovets <styx.mp@gmail.com>
This commit is contained in:
parent
4cc0a2638c
commit
a7e79824f8
2 changed files with 57 additions and 0 deletions
29
plugins/mix-fast/mix-fast.plugin.zsh
Normal file
29
plugins/mix-fast/mix-fast.plugin.zsh
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
_mix_refresh () {
|
||||
if [ -f .mix_tasks ]; then
|
||||
rm .mix_tasks
|
||||
fi
|
||||
echo "Generating .mix_tasks..." > /dev/stderr
|
||||
_mix_generate
|
||||
cat .mix_tasks
|
||||
}
|
||||
|
||||
_mix_does_task_list_need_generating () {
|
||||
[ ! -f .mix_tasks ];
|
||||
}
|
||||
|
||||
_mix_generate () {
|
||||
mix --help | grep -v 'iex -S' | tail -n +2 | cut -d " " -f 2 > .mix_tasks
|
||||
}
|
||||
|
||||
_mix () {
|
||||
if [ -f mix.exs ]; then
|
||||
if _mix_does_task_list_need_generating; then
|
||||
echo "\nGenerating .mix_tasks..." > /dev/stderr
|
||||
_mix_generate
|
||||
fi
|
||||
compadd `cat .mix_tasks`
|
||||
fi
|
||||
}
|
||||
|
||||
compdef _mix mix
|
||||
alias mix_refresh='_mix_refresh'
|
||||
Loading…
Add table
Add a link
Reference in a new issue