Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenan Yildirim <kenan@kenany.me>2015-03-11 17:44:23 +0300
committerForrest L Norvell <forrest@npmjs.com>2015-03-12 23:43:10 +0300
commitfcd92476f3a9092f6f8c83a19a24fe63b206edcd (patch)
tree5acb330a27fe8cd3b1709b432285577c9ca92e96 /scripts
parenta91f2c7c9a5183d9cde7aae040ebd9ccdf104be7 (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-xscripts/update-authors.sh20
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