mirror of
https://github.com/oh-my-fish/oh-my-fish.git
synced 2024-11-24 04:11:40 +08:00
[split] Move bundler plugin to oh-my-fish/plugin-bundler
https://github.com/oh-my-fish/plugin-bundler
This commit is contained in:
parent
dfff6fa679
commit
26332748f7
|
@ -1,63 +0,0 @@
|
||||||
# These methods override the default calls to append `bundle exec` if this gem
|
|
||||||
# is available within the context of bundler.
|
|
||||||
#
|
|
||||||
# You can add more bundled executables in your config.fish:
|
|
||||||
#
|
|
||||||
# set bundler_plugin_execs jekyll mustache
|
|
||||||
#
|
|
||||||
set -l execs annotate \
|
|
||||||
cap \
|
|
||||||
capify \
|
|
||||||
cucumber \
|
|
||||||
dashing \
|
|
||||||
foreman \
|
|
||||||
guard \
|
|
||||||
kitchen \
|
|
||||||
middleman \
|
|
||||||
nanoc \
|
|
||||||
puma \
|
|
||||||
rackup \
|
|
||||||
rainbows \
|
|
||||||
rake \
|
|
||||||
rspec \
|
|
||||||
rubocop \
|
|
||||||
ruby \
|
|
||||||
shotgun \
|
|
||||||
sidekiq \
|
|
||||||
spec \
|
|
||||||
spinach \
|
|
||||||
spork \
|
|
||||||
thin \
|
|
||||||
thor \
|
|
||||||
unicorn \
|
|
||||||
unicorn_rails
|
|
||||||
|
|
||||||
if set -q bundler_plugin_execs
|
|
||||||
set execs $execs $bundler_plugin_execs
|
|
||||||
end
|
|
||||||
|
|
||||||
# Fish 2.1.1+ has support for --inherit-variable
|
|
||||||
set -l do_eval (echo $FISH_VERSION | grep 2.1.1-)
|
|
||||||
|
|
||||||
for executable in $execs
|
|
||||||
if test -z "$do_eval"
|
|
||||||
eval "function $executable; __execute_as_bundler $executable \$argv; end"
|
|
||||||
else
|
|
||||||
function $executable --inherit-variable executable
|
|
||||||
__execute_as_bundler $executable $argv
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function __execute_as_bundler
|
|
||||||
if __is_a_bundled_executable $argv[1]
|
|
||||||
command bundle exec $argv
|
|
||||||
else
|
|
||||||
eval command $argv
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function __is_a_bundled_executable
|
|
||||||
set -l bindir (command bundle exec ruby -e 'puts Gem.bindir')
|
|
||||||
test -f "$bindir/$argv"
|
|
||||||
end
|
|
Loading…
Reference in New Issue
Block a user