mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-26 21:51:05 +01:00
changed names of functions and variables to fit naming conventions
This commit is contained in:
parent
05883f3831
commit
3aee5c1941
1 changed files with 9 additions and 9 deletions
|
@ -5,26 +5,26 @@ bundled_commands=(cucumber heroku rackup rails rake rspec ruby shotgun spec spor
|
||||||
|
|
||||||
## Functions
|
## Functions
|
||||||
|
|
||||||
bundler-installed()
|
_bundler-installed()
|
||||||
{
|
{
|
||||||
which bundle > /dev/null 2>&1
|
which bundle > /dev/null 2>&1
|
||||||
}
|
}
|
||||||
|
|
||||||
within-bundled-project()
|
_within-bundled-project()
|
||||||
{
|
{
|
||||||
local dir="$(pwd)"
|
local check_dir=$PWD
|
||||||
while [ "$(dirname $dir)" != "/" ]; do
|
while [ "$(dirname $check_dir)" != "/" ]; do
|
||||||
[ -f "$dir/Gemfile" ] && return
|
[ -f "$check_dir/Gemfile" ] && return
|
||||||
dir="$(dirname $dir)"
|
dir="$(dirname $check_dir)"
|
||||||
done
|
done
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
|
||||||
run-with-bundler()
|
_run-with-bundler()
|
||||||
{
|
{
|
||||||
local command="$1"
|
local command="$1"
|
||||||
shift
|
shift
|
||||||
if bundler-installed && within-bundled-project; then
|
if _bundler-installed && _within-bundled-project; then
|
||||||
bundle exec $command "$@"
|
bundle exec $command "$@"
|
||||||
else
|
else
|
||||||
$command "$@"
|
$command "$@"
|
||||||
|
@ -33,5 +33,5 @@ run-with-bundler()
|
||||||
|
|
||||||
## Main program
|
## Main program
|
||||||
for cmd in $bundled_commands; do
|
for cmd in $bundled_commands; do
|
||||||
alias $cmd="run-with-bundler $cmd"
|
alias $cmd="_run-with-bundler $cmd"
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in a new issue