|
|
@@ -77,6 +77,7 @@ var getTaskCheckExists = (command, options) => { |
|
|
|
} |
|
|
|
|
|
|
|
var getPullCmd = (repo, branch) => { |
|
|
|
// console.log(useGitPull)var getPullCmd = (repo, branch) => { |
|
|
|
// console.log(useGitPull) |
|
|
|
|
|
|
|
if(branch) { |
|
|
@@ -100,12 +101,27 @@ var getPullCmd = (repo, branch) => { |
|
|
|
return pullCmd |
|
|
|
} |
|
|
|
|
|
|
|
// var getPullCmd = (repo, branch) => { |
|
|
|
// var pullCmd = [gitbash |
|
|
|
// , ['-c', 'branch=`git rev-parse --abbrev-ref HEAD`;for i in `git remote`; do git pull $i $branch; done;'] |
|
|
|
// , { cwd: instanceroot + '/' + repo, title: 'pull all origins for ' + repo }] |
|
|
|
// // var pullCmd = ['pullall', [], { cwd : repo }] |
|
|
|
// if (useGitPull) pullCmd = ['git', ['pull'], { |
|
|
|
// inherit: true, shell: true, |
|
|
|
// cwd: instanceroot + '/' + repo |
|
|
|
// // , env: process.env |
|
|
|
// , runas: processedArgs.runas |
|
|
|
// , title: `git pull ${repo}` |
|
|
|
// }] |
|
|
|
// return pullCmd |
|
|
|
// } |
|
|
|
|
|
|
|
var performPull = (repo, branch) => { |
|
|
|
if (existsSync(instanceroot + '/' + repo)) { |
|
|
|
var branchprint = branch ? ' branch :' + branch : ''; |
|
|
|
console.log('pulling ' + instanceroot + '/' + repo + branchprint ) |
|
|
|
return nodeShellExec.apply(null, getPullCmd(repo, branch)).then(() => { |
|
|
|
if (__isElevated) { |
|
|
|
if (__isElevated) { |
|
|
|
fs.writeFileSync('run.log', ', ' + JSON.stringify({ repo, success: true }), { 'flag': 'a+' }) |
|
|
|
} |
|
|
|
else statuslog.statuslog(null, repo) |
|
|
@@ -765,11 +781,14 @@ var op = { |
|
|
|
gitRepos = gitRepos.concat(elevatedRunasRepos); |
|
|
|
|
|
|
|
// gitRepos = [ |
|
|
|
// 'bbhverse', 'serververse', 'elixir-server', |
|
|
|
// // 'bbhverse', 'serververse', 'elixir-server', |
|
|
|
// // 'clientverse', |
|
|
|
// 'client' |
|
|
|
// ]; |
|
|
|
var rmtasks = [] |
|
|
|
var repotasks = [] |
|
|
|
var env = Object.assign({}, process.env) |
|
|
|
delete env.NODE_ENV |
|
|
|
gitRepos.forEach(repo => { |
|
|
|
|
|
|
|
rmtasks.push( |
|
|
@@ -795,25 +814,30 @@ var op = { |
|
|
|
var p = nodeShellExec('npm', ['i', '--force'], { |
|
|
|
inherit: true, shell: true |
|
|
|
, cwd: instanceroot + '/' + repo |
|
|
|
, env: process.env |
|
|
|
, env |
|
|
|
, title: `npm i for ${repo}` |
|
|
|
}).then(Tasq.then).catch(Tasq.catch) |
|
|
|
}).then(Tasq.then).catch(Tasq.catch) |
|
|
|
return p; |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
// PB : TODO -- npm i for client is for some reason not complete so bower doesn't get installed !!! |
|
|
|
// PB : NOTE -- npm i for client does not complete when NODE_ENV=production |
|
|
|
// therefore bower doesn't get installed !!! which then fails installing the bower dependenciew !!! |
|
|
|
// We work around this by running npm i for client without any NODE_ENV which probably defualts to development. |
|
|
|
// PB : TODO -- Investigate why NODE_ENF has an impact on npm i !?? |
|
|
|
// Second time try also doesnt work. |
|
|
|
// repotasks.push( |
|
|
|
// () => { |
|
|
|
// var env = Object.assign({}, process.env) |
|
|
|
// delete env.NODE_ENV |
|
|
|
// console.log(`--------------------second time npm i for client--------------------`) |
|
|
|
// return nodeShellExec(`"${gitbash}"`, ['-c', '"npm i"'], { |
|
|
|
// return nodeShellExec(`"${gitbash}"`, ['-c', '"npm i --force"'], { |
|
|
|
// // return nodeShellExec('npm', ['i --force'], { |
|
|
|
// inherit: true, shell: true |
|
|
|
// , cwd: instanceroot + '/' + 'client' |
|
|
|
// , env: process.env |
|
|
|
// , env |
|
|
|
// , title: `npm i for client` |
|
|
|
// }).then(Tasq.then).catch(Tasq.catch) |
|
|
|
// }) |