1 | var $;
|
2 |
|
3 | $ = {};
|
4 |
|
5 | $.normalizePath = require('../dist/normalizePath');
|
6 |
|
7 | $.isExisted_ = require('../dist/isExisted_');
|
8 |
|
9 | $.exec_ = require('../dist/exec_');
|
10 |
|
11 | module.exports = async function(name) {
|
12 | var source;
|
13 | source = $.normalizePath(`./../${(name.split('/')[1])}`);
|
14 | if ((await $.isExisted_(source))) {
|
15 | return (await $.exec_([`cd ${source}`, 'git fetch', 'git pull']));
|
16 | }
|
17 | return (await $.exec_(`git clone https://github.com/${name}.git ${source}`));
|
18 | };
|