浏览代码

Add contributors script

Ben Hsieh 8 年前
父节点
当前提交
97cb89a79d
共有 1 个文件被更改,包括 21 次插入0 次删除
  1. 21
    0
      scripts/contributors.sh

+ 21
- 0
scripts/contributors.sh 查看文件

@@ -0,0 +1,21 @@
1
+
2
+git log --pretty="%an <%ae>" | sort |uniq > CONTRIBUTORS.md
3
+sed -i.bak '/xeiyan@gmail.com/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"