-
Notifications
You must be signed in to change notification settings - Fork 5
/
init.sh
executable file
·41 lines (32 loc) · 1.22 KB
/
init.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/env bash
# EDIT ZONE START
GITHUB_USERNAME="YOUR-GITHUB-USERNAME"
GITHUB_TOKEN="YOUR-GITHUB-TOKEN"
# EDIT ZONE STOP
# Checking if initializing process using parameter or file
if [ $# -eq 2 ]; then
echo "Initializing $1 page"
echo "machine api.github.com" >> ~/.netrc
echo " login $1" >> ~/.netrc
echo " password $2" >> ~/.netrc
echo "machine uploads.github.com" >> ~/.netrc
echo " login $1" >> ~/.netrc
echo " password $2" >> ~/.netrc
# If you don't have any credentials configured on git, you need the following lines
echo "machine github.com" >> ~/.netrc
echo " login $1" >> ~/.netrc
echo " password $2" >> ~/.netrc
chmod 600 ~/.netrc
# Initializing all data
echo "GITHUB_USER=$1" > data/profile.txt
echo "Date,Follower" > data/follower.txt
echo "Date,Following" > data/following.txt
echo "Date,Stars" > data/num_stars.txt
echo "Date,Num Repo" > data/num_repo.txt
echo "Date,Num Users" > data/num_github_users.txt
echo "Date,Num Users" > data/num_github_users_followers.txt
echo "Date,Num Users" > data/num_github_users_repo.txt
else
echo "Please include username and token"
echo "Usage: $ ./init.sh username token"
fi