diff options
author | Kenan Yildirim <kenan@kenany.me> | 2015-03-11 17:44:23 +0300 |
---|---|---|
committer | Forrest L Norvell <forrest@npmjs.com> | 2015-03-12 23:43:10 +0300 |
commit | fcd92476f3a9092f6f8c83a19a24fe63b206edcd (patch) | |
tree | 5acb330a27fe8cd3b1709b432285577c9ca92e96 /scripts | |
parent | a91f2c7c9a5183d9cde7aae040ebd9ccdf104be7 (diff) |
doc: use perl in update-authors.sh instead of awk
As a consequence of the various implementations of AWK across platforms,
the use of AWK in `scripts/update-authors.sh` might result in different
sorting behavior on different platforms (i.e. BSD awk on OS X does not
maintain the desired sort- by-first-contribution). So, let's use Perl
instead.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/update-authors.sh | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/scripts/update-authors.sh b/scripts/update-authors.sh index 8708e240e..326d21cc8 100755 --- a/scripts/update-authors.sh +++ b/scripts/update-authors.sh @@ -1,20 +1,18 @@ #!/bin/sh -git log --reverse --format='%aN <%aE>' | awk ' +git log --reverse --format='%aN <%aE>' | perl -we ' + BEGIN { - print "# Authors sorted by whether or not they'\''re me"; + %seen = (), @authors = (); } -{ - if (all[$NF] != 1) { - all[$NF] = 1; - ordered[length(all)] = $0; - } +while (<>) { + next if $seen{$_}; + $seen{$_} = push @authors, $_; } END { - for (i in ordered) { - print ordered[i]; - } + print "# Authors sorted by whether or not they'\''re me\n"; + print @authors; } -' > AUTHORS
\ No newline at end of file +' > AUTHORS |