mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-02-20 03:02:29 +01:00
Adds bundler bump completion
This commit is contained in:
parent
e2838f75f0
commit
0283d426bf
2 changed files with 29 additions and 0 deletions
26
plugins/bundler_bump/_bundler_bump
Normal file
26
plugins/bundler_bump/_bundler_bump
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
#compdef bump
|
||||
#autoload
|
||||
|
||||
local curcontext="$curcontext" state line ret=1
|
||||
local -a _configs
|
||||
|
||||
_arguments -C \
|
||||
'1: :->cmds'
|
||||
|
||||
_bundle_gems() {
|
||||
if [ -f Gemfile ]; then
|
||||
OLD_IFS=$IFS
|
||||
IFS=$'\n'
|
||||
_values 'available gems' $(awk '/gem / {print $2}' Gemfile | sed 's/[^a-zA-Z0-9_-]//g')
|
||||
IFS=$OLD_IFS
|
||||
fi
|
||||
}
|
||||
|
||||
case $state in
|
||||
cmds)
|
||||
_bundle_gems
|
||||
ret=0
|
||||
;;
|
||||
esac
|
||||
|
||||
return ret
|
||||
3
plugins/bundler_bump/bundler_bump.plugin.zsh
Normal file
3
plugins/bundler_bump/bundler_bump.plugin.zsh
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
func bump() {
|
||||
bundle update --source $*
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue