|
|
|
|
|
|
|
|
return nodeShellExec('git', ['-C', dir.name, 'rev-parse'], { stdio : 'ignore'}) |
|
|
return nodeShellExec('git', ['-C', dir.name, 'rev-parse'], { stdio : 'ignore'}) |
|
|
} |
|
|
} |
|
|
, 'add' : (remotename, url, branch) => { |
|
|
, 'add' : (remotename, url, branch) => { |
|
|
|
|
|
var pushable = processedArgs.pushable || false; |
|
|
remotename = remotename || processedArgs._[1] |
|
|
remotename = remotename || processedArgs._[1] |
|
|
url = url || processedArgs._[2] |
|
|
url = url || processedArgs._[2] |
|
|
branch = branch || processedArgs._[3] |
|
|
branch = branch || processedArgs._[3] |
|
|
var serial_perform_git_add = (repo)=>{ |
|
|
var serial_perform_git_add = (repo)=>{ |
|
|
var options = { cwd : repo } |
|
|
var options = { cwd : repo } |
|
|
// console.log(repo) |
|
|
// console.log(repo) |
|
|
return [ |
|
|
|
|
|
['git', ['remote', 'add', remotename, url + '/' + repo], { cwd : repo }] |
|
|
|
|
|
, ['git', ['remote', `set-url`, '--push', remotename, 'no-pushing'], { cwd : repo }] |
|
|
|
|
|
, ['git', ['pull', remotename, branch], { cwd : repo }] |
|
|
|
|
|
, ['git', ['branch', `--set-upstream-to=${remotename}/${branch}`, branch], { cwd : repo }] |
|
|
|
|
|
] |
|
|
|
|
|
|
|
|
if(pushable) { |
|
|
|
|
|
return [ |
|
|
|
|
|
['git', ['remote', 'add', remotename, url + '/' + repo], { cwd : repo }] |
|
|
|
|
|
, ['git', ['pull', remotename, branch], { cwd : repo }] |
|
|
|
|
|
, ['git', ['branch', `--set-upstream-to=${remotename}/${branch}`, branch], { cwd : repo }] |
|
|
|
|
|
] |
|
|
|
|
|
} |
|
|
|
|
|
else { |
|
|
|
|
|
|
|
|
|
|
|
return [ |
|
|
|
|
|
['git', ['remote', 'add', remotename, url + '/' + repo], { cwd : repo }] |
|
|
|
|
|
, ['git', ['remote', `set-url`, '--push', remotename, 'no-pushing'], { cwd : repo }] |
|
|
|
|
|
, ['git', ['pull', remotename, branch], { cwd : repo }] |
|
|
|
|
|
, ['git', ['branch', `--set-upstream-to=${remotename}/${branch}`, branch], { cwd : repo }] |
|
|
|
|
|
] |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
var x = (args)=>{ |
|
|
var x = (args)=>{ |
|
|
return ()=>{ |
|
|
return ()=>{ |