Skip to content
This repository was archived by the owner on Mar 16, 2019. It is now read-only.

Commit 97cb89a

Browse files
committed
Add contributors script
1 parent ce46768 commit 97cb89a

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

scripts/contributors.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
2+
git log --pretty="%an <%ae>" | sort |uniq > CONTRIBUTORS.md
3+
sed -i.bak '/[email protected]/d' ./CONTRIBUTORS.md
4+
rm CONTRIBUTORS.md.bak
5+
6+
echo "list contributors .."
7+
8+
cat CONTRIBUTORS.md
9+
10+
echo "update package.json .."
11+
12+
node -e "var fs = require('fs');\
13+
var json = JSON.parse(fs.readFileSync('./package.json'));\
14+
var contributors = String(fs.readFileSync('./CONTRIBUTORS.md')).split(/[\r\n]/);\
15+
json.contributors = contributors;\
16+
var distJSON = JSON.parse(fs.readFileSync('./src/package.json'));\
17+
distJSON.contributors = contributors;\
18+
fs.writeFileSync('./src/package.json', JSON.stringify(distJSON, null, 2));\
19+
fs.writeFileSync('./package.json', JSON.stringify(json, null, 2));"
20+
21+
echo "done"

0 commit comments

Comments
 (0)