Commit dd6a203d authored by Vitaly Lipatov's avatar Vitaly Lipatov

fix is_gear script for use get_root_git_dir

parent 468fac7b
...@@ -63,13 +63,9 @@ is_gear() ...@@ -63,13 +63,9 @@ is_gear()
{ {
local DIR=$1 local DIR=$1
[ -z "$IGNOREGEAR" ] || return 1 [ -z "$IGNOREGEAR" ] || return 1
[ -n "$DIR" ] && DIR=$DIR/ local GITDIR=$(get_root_git_dir "$DIR")
[ -r "${DIR}.gear/rules" ] && return 0 [ -d "$GITDIR/.gear" ] && return 0
[ -r "$GITDIR/.gear-rules" ] && return 0
[ -r "$DIR/.gear-rules" ] && return 0
# hack for support spec in some subdir
[ -d "../.gear" ] && return 0
return 1 return 1
} }
......
...@@ -4,3 +4,10 @@ ...@@ -4,3 +4,10 @@
load_mod git load_mod git
get_root_git_dir get_root_git_dir
echo "test gear for curdir"
is_gear && echo "IS GEAR" || echo "IS NOT GEAR"
echo "test gear for root_git_dir"
is_gear $(get_root_git_dir) && echo "IS GEAR" || echo "IS NOT GEAR"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment