Skip to content

Commit 313d65b

Browse files
committed
Improve metadata
1 parent 79115a3 commit 313d65b

File tree

1 file changed

+26
-3
lines changed

1 file changed

+26
-3
lines changed
Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#!/bin/sh
2-
# set -eu
1+
#!/bin/zsh
2+
set -eu
33

44
# CREATE INSTALL SH
55
# Make install.txt, a user-readable provenance file
@@ -8,6 +8,19 @@ OUTPUT=$1
88
INSTALL_PREFIX=$2
99
ENABLE_DEB=$3
1010

11+
THIS=${0:h:A}
12+
13+
report-timestamp()
14+
{
15+
TIMESTAMP=$THIS/../../../dev/build/timestamp.txt
16+
if [[ -f $TIMESTAMP ]]
17+
then
18+
cat $TIMESTAMP
19+
else
20+
echo "TIMESTAMP MISSING"
21+
fi
22+
}
23+
1124
{
1225
echo "PREFIX: $INSTALL_PREFIX"
1326
echo "ENABLE_DEB: $ENABLE_DEB"
@@ -16,5 +29,15 @@ ENABLE_DEB=$3
1629

1730
echo -n "REPO: "
1831
# Use true to ignore errors (e.g., if this is not an git clone)
19-
git log -n 1 --pretty=format:"COMMIT: %h %aD %s%n" 2>&1 || true
32+
if git log -n 1 > /dev/null 2>&1
33+
then
34+
git log -n 1 --pretty=format:"COMMIT: %h %aD %s%n" 2>&1
35+
elif (( ${CONDA_BUILD:-0} ))
36+
then
37+
echo "CONDA:"
38+
report-timestamp
39+
else
40+
echo "RELEASE:"
41+
report-timestamp
42+
fi
2043
} > $OUTPUT

0 commit comments

Comments
 (0)