1 | #!/bin/bash
|
2 | cd /tmp
|
3 | echo "Forking $1/$2";
|
4 | curl -X POST -H "Authorization: token $TOKEN" https://api.github.com/repos/$1/$2/forks?org=opencollective
|
5 | git clone git@github.com:opencollective/$2.git
|
6 | cd $2;
|
7 | git checkout -b opencollective
|
8 | npm install --save opencollective
|
9 | opencollective setup
|
10 | open README.md
|
11 | echo "Please double check README.md";
|
12 | echo "Continue? (Y/n)";
|
13 | read continue;
|
14 | if [ "$continue" = "n" ]; then exit 0; fi;
|
15 | git add README.md
|
16 | git commit -m "Added backers and sponsors on the README"
|
17 | git add package.json
|
18 | git commit -m "Added call to donate after npm install"
|
19 | git push origin opencollective
|
20 |
|
21 | curl -X POST -H "Authorization: token $TOKEN" https://api.github.com/repos/$1/$2/pulls --data "{\"title\":\"Activating Open Collective\", \"body\": \"Please merge this pull request to activate your Open Collective https://opencollective.com/$2\", \"head\":\"opencollective:opencollective\",\"base\":\"master\"}"
|
22 |
|
23 |
|
24 | rm -rf $2
|
25 | cd -
|