Skip to content

Commit c9edcdb

Browse files
committed
Tweak the add-authors.sh script
1 parent 002b3b3 commit c9edcdb

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/etc/add-authors.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818
# changes. If there are incorrect additions fix it by editing
1919
# .mailmap and re-running the script.
2020

21+
if [ "${1-}" = "" ]; then
22+
echo "Usage: add-authors.sh 1.0.0..rust-lang/master"
23+
exit 1
24+
fi
25+
2126
set -u -e
2227

2328
range="$1"
@@ -27,6 +32,6 @@ tmp_file="./AUTHORS.txt.tmp"
2732
old_authors="$(cat "$authors_file" | tail -n +2 | sed "/^$/d" | sort)"
2833
new_authors="$(git log "$range" --format="%aN <%aE>" | sort | uniq)"
2934

30-
echo "Rust was written by these fine people:\n" > "$tmp_file"
31-
echo "$old_authors\n$new_authors" | sort | uniq >> "$tmp_file"
35+
printf "%s\n\n" "Rust was written by these fine people:" > "$tmp_file"
36+
printf "%s\n%s" "$old_authors" "$new_authors" | sort | uniq >> "$tmp_file"
3237
mv -f "$tmp_file" "$authors_file"

0 commit comments

Comments
 (0)