| 
														 | 
														 | 
														 | 
														 | 
														 | 
													
													
												
													
														 | 
														 | 
														} | 
														 | 
														 | 
														} | 
													
													
												
													
														 | 
														 | 
														
  | 
														 | 
														 | 
														
  | 
													
													
												
													
														 | 
														 | 
														var getPullCmd = (repo, branch) => { | 
														 | 
														 | 
														var getPullCmd = (repo, branch) => { | 
													
													
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														  // console.log(useGitPull)var getPullCmd = (repo, branch) => { | 
													
													
												
													
														 | 
														 | 
														  // console.log(useGitPull) | 
														 | 
														 | 
														  // console.log(useGitPull) | 
													
													
												
													
														 | 
														 | 
														
  | 
														 | 
														 | 
														
  | 
													
													
												
													
														 | 
														 | 
														  if(branch) { | 
														 | 
														 | 
														  if(branch) { | 
													
													
												
											
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														 | 
													
													
												
													
														 | 
														 | 
														  return pullCmd | 
														 | 
														 | 
														  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) => { | 
														 | 
														 | 
														var performPull = (repo, branch) => { | 
													
													
												
													
														 | 
														 | 
														  if (existsSync(instanceroot + '/' + repo)) { | 
														 | 
														 | 
														  if (existsSync(instanceroot + '/' + repo)) { | 
													
													
												
													
														 | 
														 | 
														    var branchprint =  branch ? ' branch :' + branch  : ''; | 
														 | 
														 | 
														    var branchprint =  branch ? ' branch :' + branch  : ''; | 
													
													
												
													
														 | 
														 | 
														    console.log('pulling ' + instanceroot + '/' + repo + branchprint ) | 
														 | 
														 | 
														    console.log('pulling ' + instanceroot + '/' + repo + branchprint ) | 
													
													
												
													
														 | 
														 | 
														    return nodeShellExec.apply(null, getPullCmd(repo, branch)).then(() => { | 
														 | 
														 | 
														    return nodeShellExec.apply(null, getPullCmd(repo, branch)).then(() => { | 
													
													
												
													
														 | 
														 | 
														      if (__isElevated) { | 
														 | 
														 | 
														 | 
													
													
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														            if (__isElevated) { | 
													
													
												
													
														 | 
														 | 
														        fs.writeFileSync('run.log', ', ' + JSON.stringify({ repo, success: true }), { 'flag': 'a+' }) | 
														 | 
														 | 
														        fs.writeFileSync('run.log', ', ' + JSON.stringify({ repo, success: true }), { 'flag': 'a+' }) | 
													
													
												
													
														 | 
														 | 
														      } | 
														 | 
														 | 
														      } | 
													
													
												
													
														 | 
														 | 
														      else statuslog.statuslog(null, repo) | 
														 | 
														 | 
														      else statuslog.statuslog(null, repo) | 
													
													
												
											
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														 | 
													
													
												
													
														 | 
														 | 
														      gitRepos = gitRepos.concat(elevatedRunasRepos); | 
														 | 
														 | 
														      gitRepos = gitRepos.concat(elevatedRunasRepos); | 
													
													
												
													
														 | 
														 | 
														
  | 
														 | 
														 | 
														
  | 
													
													
												
													
														 | 
														 | 
														      // gitRepos = [ | 
														 | 
														 | 
														      // gitRepos = [ | 
													
													
												
													
														 | 
														 | 
														      //   'bbhverse', 'serververse', 'elixir-server',  | 
														 | 
														 | 
														 | 
													
													
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														      //   // 'bbhverse', 'serververse', 'elixir-server',  | 
													
													
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														      //   // 'clientverse',  | 
													
													
												
													
														 | 
														 | 
														      //   'client' | 
														 | 
														 | 
														      //   'client' | 
													
													
												
													
														 | 
														 | 
														      // ]; | 
														 | 
														 | 
														      // ]; | 
													
													
												
													
														 | 
														 | 
														      var rmtasks = [] | 
														 | 
														 | 
														      var rmtasks = [] | 
													
													
												
													
														 | 
														 | 
														      var repotasks = [] | 
														 | 
														 | 
														      var repotasks = [] | 
													
													
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														      var env = Object.assign({}, process.env) | 
													
													
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														      delete env.NODE_ENV | 
													
													
												
													
														 | 
														 | 
														      gitRepos.forEach(repo => { | 
														 | 
														 | 
														      gitRepos.forEach(repo => { | 
													
													
												
													
														 | 
														 | 
														
  | 
														 | 
														 | 
														
  | 
													
													
												
													
														 | 
														 | 
														        rmtasks.push( | 
														 | 
														 | 
														        rmtasks.push( | 
													
													
												
											
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														 | 
													
													
												
													
														 | 
														 | 
														              var p = nodeShellExec('npm', ['i', '--force'], { | 
														 | 
														 | 
														              var p = nodeShellExec('npm', ['i', '--force'], { | 
													
													
												
													
														 | 
														 | 
														                inherit: true, shell: true | 
														 | 
														 | 
														                inherit: true, shell: true | 
													
													
												
													
														 | 
														 | 
														                , cwd: instanceroot + '/' + repo | 
														 | 
														 | 
														                , cwd: instanceroot + '/' + repo | 
													
													
												
													
														 | 
														 | 
														                , env: process.env | 
														 | 
														 | 
														 | 
													
													
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														                , env | 
													
													
												
													
														 | 
														 | 
														                , title: `npm i for ${repo}` | 
														 | 
														 | 
														                , title: `npm i for ${repo}` | 
													
													
												
													
														 | 
														 | 
														              }).then(Tasq.then).catch(Tasq.catch) | 
														 | 
														 | 
														 | 
													
													
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														              }).then(Tasq.then).catch(Tasq.catch)   | 
													
													
												
													
														 | 
														 | 
														              return p; | 
														 | 
														 | 
														              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. | 
														 | 
														 | 
														      // Second time try also doesnt work. | 
													
													
												
													
														 | 
														 | 
														      // repotasks.push( | 
														 | 
														 | 
														      // repotasks.push( | 
													
													
												
													
														 | 
														 | 
														      //   () => { | 
														 | 
														 | 
														      //   () => { | 
													
													
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														      //     var env = Object.assign({}, process.env) | 
													
													
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														      //     delete env.NODE_ENV | 
													
													
												
													
														 | 
														 | 
														      //     console.log(`--------------------second time npm i for client--------------------`) | 
														 | 
														 | 
														      //     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'], { | 
														 | 
														 | 
														      //     // return nodeShellExec('npm', ['i --force'], { | 
													
													
												
													
														 | 
														 | 
														      //       inherit: true, shell: true | 
														 | 
														 | 
														      //       inherit: true, shell: true | 
													
													
												
													
														 | 
														 | 
														      //       , cwd: instanceroot + '/' + 'client' | 
														 | 
														 | 
														      //       , cwd: instanceroot + '/' + 'client' | 
													
													
												
													
														 | 
														 | 
														      //       , env: process.env | 
														 | 
														 | 
														 | 
													
													
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														      //       , env | 
													
													
												
													
														 | 
														 | 
														      //       , title: `npm i for client` | 
														 | 
														 | 
														      //       , title: `npm i for client` | 
													
													
												
													
														 | 
														 | 
														      //     }).then(Tasq.then).catch(Tasq.catch) | 
														 | 
														 | 
														      //     }).then(Tasq.then).catch(Tasq.catch) | 
													
													
												
													
														 | 
														 | 
														      //   }) | 
														 | 
														 | 
														      //   }) |