UNPKG

988 Bapplication/x-shView Raw
1#!/bin/bash
2cd /tmp
3echo "Forking $1/$2";
4curl -X POST -H "Authorization: token $TOKEN" https://api.github.com/repos/$1/$2/forks?org=opencollective
5git clone git@github.com:opencollective/$2.git
6cd $2;
7git checkout -b opencollective
8npm install --save opencollective
9opencollective setup
10open README.md
11echo "Please double check README.md";
12echo "Continue? (Y/n)";
13read continue;
14if [ "$continue" = "n" ]; then exit 0; fi;
15git add README.md
16git commit -m "Added backers and sponsors on the README"
17git add package.json
18git commit -m "Added call to donate after npm install"
19git push origin opencollective
20
21curl -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# We clean the directory and go back to where we were
24rm -rf $2
25cd -