Skip to content

Commit c8c9e39

Browse files
committed
clgen: Make it work on other people's machines
1 parent 079cb65 commit c8c9e39

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

clgen.sh

+16-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,22 @@
11
#!/bin/bash
2+
set -eou pipefail
3+
4+
sd() {
5+
sed -E "s/$1/$2/g"
6+
}
7+
col2() {
8+
awk '{print $2}'
9+
}
10+
col6() {
11+
awk '{print $6}'
12+
}
13+
grepor() {
14+
grep $1 || true
15+
}
216

317
for version_tag in $(git tag --sort=-version:refname); do
4-
date=$(git show -s $version_tag --format=%ci | sd "[0-9]{2}:[0-9]{2}:[0-9]{2} \\+[0-9]{4}" "")
5-
format_version=$(git show $version_tag:src/lib.rs | grep FORMAT_VERSION | col6 | sd ";" "")
18+
date=$(git show -s $version_tag --format=%ci | sd "[0-9]{2}:[0-9]{2}:[0-9]{2} \+[0-9]{4}" "")
19+
format_version=$(git show $version_tag:src/lib.rs | grepor FORMAT_VERSION | col6 | sd ";" "")
620

721
if [[ $version_tag == "v0.1.0" ]]; then
822
prev_tag=""

0 commit comments

Comments
 (0)