Skip to content
This repository was archived by the owner on Apr 27, 2020. It is now read-only.

Commit fd38dbb

Browse files
Add scripts/update-authors.sh that updates AUTHORS file (#39)
1 parent ee88690 commit fd38dbb

File tree

4 files changed

+38
-0
lines changed

4 files changed

+38
-0
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,6 @@ before_script:
3535
- JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}'; until kubectl get nodes -o jsonpath="$JSONPATH" 2>&1 | grep -q "Ready=True"; do sleep 1; done
3636

3737
script:
38+
- ./scripts/verify-authors.sh
3839
- make lint
3940
- make test

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ Kazuki Suda
55
Etourneau Gwenn
66
Tanner Bruce
77
Takuhiro Yoshida
8+
O. Yuanying
89
Anne Schuth

scripts/update-authors.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env bash
2+
3+
set -e -o pipefail
4+
5+
SCRIPT_ROOT="$(dirname "${BASH_SOURCE}")/.."
6+
AUTHORS_FILE="${AUTHORS_FILE:-"${SCRIPT_ROOT}/AUTHORS"}"
7+
8+
cat <<EOL > "$AUTHORS_FILE"
9+
List of contributors
10+
====================
11+
12+
$(git log --format='%at,%an' | sort -t, -n | awk -F, '{if (!a[$2]++) print $2;}')
13+
EOL

scripts/verify-authors.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env bash
2+
3+
set -e -o pipefail
4+
5+
SCRIPT_ROOT="$(dirname "${BASH_SOURCE}")/.."
6+
TMP_ROOT="$(mktemp -d)"
7+
8+
cleanup() {
9+
rm -rf "$TMP_ROOT"
10+
}
11+
trap "cleanup" EXIT SIGINT
12+
13+
export AUTHORS_FILE="${TMP_ROOT}/AUTHORS"
14+
"${SCRIPT_ROOT}/scripts/update-authors.sh"
15+
16+
ret=0
17+
diff "${SCRIPT_ROOT}/AUTHORS" "$AUTHORS_FILE" || ret=$?
18+
19+
if [[ $ret -eq 0 ]]; then
20+
echo "AUTHORS is up to date."
21+
else
22+
echo "AUTHORS is out of date. Please run scripts/update-authors.sh."
23+
fi

0 commit comments

Comments
 (0)