Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
etersoft-build-utils
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
korinf
etersoft-build-utils
Commits
ef0edad8
Commit
ef0edad8
authored
Jun 02, 2012
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rewrite get_root_git_dir with using $ git rev-parse --git-dir
is_gear: fix get_root_dir_dir using
parent
de3c03db
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
9 deletions
+4
-9
common
share/eterbuild/functions/common
+4
-9
No files found.
share/eterbuild/functions/common
View file @
ef0edad8
...
@@ -87,15 +87,8 @@ print_list()
...
@@ -87,15 +87,8 @@ print_list()
get_root_git_dir
()
get_root_git_dir
()
{
{
local
DIR
=
"
$1
"
local
DIR
=
$(
git rev-parse
--git-dir
)
/../
[
-n
"
$DIR
"
]
||
DIR
=
$(
pwd
)
[
"
$DIR
"
=
"/"
]
&&
return
1
[
"
$DIR
"
=
"
$HOME
"
]
&&
return
1
if
[
-d
"
$DIR
/.git"
]
;
then
readlink
-f
"
$DIR
"
2>/dev/null
||
realpath
"
$DIR
"
readlink
-f
"
$DIR
"
2>/dev/null
||
realpath
"
$DIR
"
return
fi
get_root_git_dir
$(
dirname
"
$DIR
"
)
||
return
1
}
}
# Usage: is_gear [path_to_spec|dir_inside_git]
# Usage: is_gear [path_to_spec|dir_inside_git]
...
@@ -104,7 +97,9 @@ is_gear()
...
@@ -104,7 +97,9 @@ is_gear()
local
DIR
=
"
$1
"
local
DIR
=
"
$1
"
[
-z
"
$IGNOREGEAR
"
]
||
return
1
[
-z
"
$IGNOREGEAR
"
]
||
return
1
[
-f
"
$DIR
"
]
&&
DIR
=
$(
dirname
"
$DIR
"
)
[
-f
"
$DIR
"
]
&&
DIR
=
$(
dirname
"
$DIR
"
)
local
GITDIR
=
$(
get_root_git_dir
"
$DIR
"
)
[
-n
"
$DIR
"
]
&&
cd
$DIR
local
GITDIR
=
$(
get_root_git_dir
)
[
-n
"
$DIR
"
]
&&
cd
-
>
/dev/null
[
-d
"
$GITDIR
/.gear"
]
&&
return
0
[
-d
"
$GITDIR
/.gear"
]
&&
return
0
[
-r
"
$GITDIR
/.gear-rules"
]
&&
return
0
[
-r
"
$GITDIR
/.gear-rules"
]
&&
return
0
return
1
return
1
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment