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
969a00e0
Commit
969a00e0
authored
Aug 31, 2022
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
functions/common: improve git root detection
parent
e87a3b90
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
3 deletions
+15
-3
common
share/eterbuild/functions/common
+14
-2
gear
share/eterbuild/functions/gear
+1
-1
No files found.
share/eterbuild/functions/common
View file @
969a00e0
...
...
@@ -276,18 +276,30 @@ get_root_git_dir()
{
local
DIR
=
local
LOCDIR
=
"
$1
"
local
RES
# no path if we have no git
which git
>
/dev/null 2>/dev/null
||
return
0
if
[
-n
"
$LOCDIR
"
]
;
then
cd
"
$LOCDIR
"
||
fatal
"Only dir arg allowed for get_root_git_dir"
fi
DIR
=
$(
git rev-parse
--git-dir
2>/dev/null
)
/../
||
DIR
=
realpath
"
$DIR
"
2>/dev/null
DIR
=
$(
git rev-parse
--git-dir
2>/dev/null
)
/../
RES
=
$?
if
[
"
$RES
"
=
0
]
;
then
realpath
"
$DIR
"
2>/dev/null
# elif [ "$RES" = 128 ] ; then
# a= git rev-parse --git-dir
# fatal "Check the error above"
fi
if
[
-n
"
$LOCDIR
"
]
;
then
cd
-
>
/dev/null
fi
return
$RES
# FIXME: 1) can return / with good status 2) no one check status later
}
...
...
share/eterbuild/functions/gear
View file @
969a00e0
...
...
@@ -91,7 +91,7 @@ filter_gear_name()
get_gear_name
()
{
local
gn
local
gitdir
=
$(
get_root_git_dir
)
local
gitdir
=
"
$(
get_root_git_dir
)
"
[
-n
"
$gitdir
"
]
||
return
gn
=
$(
basename
"
$gitdir
"
| filter_gear_name
)
echo
"
$gn
"
...
...
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