Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openfoam
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
openfoam
Commits
7fb61ed9
Commit
7fb61ed9
authored
15 years ago
by
Mark Olesen
Browse files
Options
Downloads
Patches
Plain Diff
wmakePrintBuild - cd first, so we get the correct git information
parent
41b196ff
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
wmake/wmakePrintBuild
+7
-6
7 additions, 6 deletions
wmake/wmakePrintBuild
with
7 additions
and
6 deletions
wmake/wmakePrintBuild
+
7
−
6
View file @
7fb61ed9
...
@@ -27,15 +27,13 @@
...
@@ -27,15 +27,13 @@
# wmakePrintBuild
# wmakePrintBuild
#
#
# Description
# Description
# Print the version used when building the project
.
# Print the version used when building the project
#
#
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
Script
=
${
0
##*/
}
usage
()
{
usage
()
{
while
[
"$#"
-ge
1
]
;
do
echo
"
$1
"
;
shift
;
done
while
[
"$#"
-ge
1
]
;
do
echo
"
$1
"
;
shift
;
done
cat
<<
USAGE
cat
<<
USAGE
usage:
$
Script
[OPTION]
usage:
$
{
0
##*/
}
[OPTION]
options:
options:
-check check the git head commit vs.
\$
WM_PROJECT_DIR/.build
-check check the git head commit vs.
\$
WM_PROJECT_DIR/.build
(exit code 0 for no changes)
(exit code 0 for no changes)
...
@@ -76,7 +74,7 @@ do
...
@@ -76,7 +74,7 @@ do
;;
;;
-v
|
-version
)
-v
|
-version
)
[
"$#"
-ge
2
]
||
usage
"'
$1
' option requires an argument"
[
"$#"
-ge
2
]
||
usage
"'
$1
' option requires an argument"
version
=
$2
version
=
"
$2
"
shift
2
shift
2
;;
;;
*
)
*
)
...
@@ -101,7 +99,10 @@ else
...
@@ -101,7 +99,10 @@ else
# get the head SHA1 when building under git
# get the head SHA1 when building under git
# if there are multiple values (eg, HEAD, origin/HEAD, ...)
# if there are multiple values (eg, HEAD, origin/HEAD, ...)
# only take the first one, which is 'HEAD'
# only take the first one, which is 'HEAD'
version
=
$(
git show-ref
--hash
=
12
--head
HEAD 2>/dev/null |
head
-1
)
version
=
$(
cd
$WM_PROJECT_DIR
2>/dev/null
&&
\
git show-ref
--hash
=
12
--head
HEAD 2>/dev/null |
head
-1
)
if
[
-n
"
$version
"
]
if
[
-n
"
$version
"
]
then
then
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment