Skip to content

Commit

Permalink
doc: use a preversion script to update AUTHORS
Browse files Browse the repository at this point in the history
  • Loading branch information
othiym23 committed May 22, 2015
1 parent 6a54917 commit b499806
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 19 deletions.
9 changes: 2 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -230,12 +230,7 @@ test: doc
tag:
npm tag npm@$(PUBLISHTAG) latest

authors:
@bash scripts/update-authors.sh &&\
git add AUTHORS &&\
git commit -m "update AUTHORS" || true

publish: authors link doc
publish: link doc
@git push origin :v$(shell npm -v) 2>&1 || true
git clean -fd &&\
git push origin $(BRANCH) &&\
Expand All @@ -248,4 +243,4 @@ release:
sandwich:
@[ $$(whoami) = "root" ] && (echo "ok"; echo "ham" > sandwich) || (echo "make it yourself" && exit 13)

.PHONY: all latest install dev link doc clean uninstall test man doc-clean docclean release authors
.PHONY: all latest install dev link doc clean uninstall test man doc-clean docclean release
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@
"test": "tap --timeout 240 test/tap/*.js",
"tap": "tap --timeout 240 test/tap/*.js",
"test-all": "npm run test-legacy && npm test",
"preversion": "bash scripts/update-authors.sh && git add AUTHORS && git commit -m \"update AUTHORS\" || true",
"prepublish": "node bin/npm-cli.js prune --prefix=. --no-global && rimraf test/*/*/node_modules && make -j4 doc",
"dumpconf": "env | grep npm | sort | uniq"
},
Expand Down
15 changes: 3 additions & 12 deletions scripts/update-authors.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
#!/bin/sh

git log --reverse --format='%aN <%aE>' | perl -we '
git log --reverse --format='%aN <%aE>' | perl -wnE '
BEGIN {
%seen = (), @authors = ();
}
while (<>) {
next if $seen{$_};
$seen{$_} = push @authors, $_;
say "# Authors sorted by whether or not they\x27re me";
}
END {
print "# Authors sorted by whether or not they'\''re me\n";
print @authors;
}
print $seen{$_} = $_ unless $seen{$_}
' > AUTHORS

0 comments on commit b499806

Please sign in to comment.