Ver código fonte

Add contributors script

Ben Hsieh 8 anos atrás
pai
commit
97cb89a79d
1 arquivos alterados com 21 adições e 0 exclusões
  1. 21
    0
      scripts/contributors.sh

+ 21
- 0
scripts/contributors.sh Ver arquivo

@@ -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"