mirror of
https://github.com/dcarrillo/prezto.git
synced 2024-09-07 10:17:33 +00:00
23 lines
330 B
Plaintext
23 lines
330 B
Plaintext
#
|
|
# Displays the path to the Ruby application root directory.
|
|
#
|
|
# Authors:
|
|
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
|
#
|
|
|
|
# function ruby-app-root {
|
|
|
|
local root_dir="$PWD"
|
|
|
|
while [[ "$root_dir" != '/' ]]; do
|
|
if [[ -f "$root_dir/Gemfile" ]]; then
|
|
print "$root_dir"
|
|
break
|
|
fi
|
|
root_dir="$root_dir:h"
|
|
done
|
|
|
|
return 1
|
|
|
|
# }
|