The project enables to clone all student repositories for the specified intensive.
-
Clone this repo and install dependencies with
npm i
. -
Create GitHub personal access token as described here.
You will have to give access only for the
repo
group. -
Set the given token into the
config.js
file, like this:const getToken = () => "token";
.Do not publish this token anywhere!
To clone student repositories for an intensive you have to run the script with the following command:
node gpr.js <intensive-descriptor> <target-dir>
,
where:
intensive-descriptor
is a course and an intensive number, e.g.ecmascript-15
target-dir
is a full path, e.g./home/username/htmlacademy/js2_15/
Intensive | Descriptor |
---|---|
HTML/CSS 1 | htmlcss |
HTML/CSS 2 | adaptive |
JS1 | javascript |
JS2 | ecmascript |
JS3 | react |
PHP 1 | php |
PHP 2 | php2 |
NodeJS | nodejs |
Animation | animation |
email |
|
Vue | vue |
node gpr.js ecmascript-15 /home/dtsaryov/htmlacademy/js2_15/
You can create an alias to be able to run the script from any location:
-
Open or create the
~/.bash_profile
file (~/.zshrc
for ZSH) -
Add the following command to the end of the file:
alias gpr='node <path-to-gpr.js>'
for example:
alias gpr='node /Users/daniil.tsaryov/uphtmlacademy/ha-get-ppl-repos/gpr.js'
-
Refresh environment with a command:
source ~/.bash_profile
(orsource ~/.zshrc
for ZSH)
Now you are able to clone all repos to the current dir with command: gpr javascript-24 .
The script creates the following directory structure:
target-dir/
|
- John.Doe/
| - 111111-cinemaaddict-15/
- John.Snow/
| - 222222-bigtrip-15/