ソースを参照

sync master fixes

pull/4/head
samuel 3年前
コミット
c75cff5236
1個のファイルの変更16行の追加9行の削除
  1. 16
    9
      index.js

+ 16
- 9
index.js ファイルの表示

@@ -66,12 +66,19 @@ var getTaskCheckExists = (command, options) => {
}
}

var getPullCmd = (repo) => {
var getPullCmd = (repo, branch) => {
// console.log(useGitPull)

var pullCmd = [gitInstallDir
, ['-c', 'branch=`git rev-parse --abbrev-ref HEAD`;for i in `git remote`; do git pull $i $branch; done;']
, { cwd: repo, title: 'pull all origins for ' + repo }]
if(branch) {
var pullCmd = [ gitInstallDir
, ['-c', 'for i in `git remote`; do git pull $i ' + branch + '; done;']
, { cwd : repo, title : 'pull all origins for ' + repo }]
}
else {
var pullCmd = [gitInstallDir
, ['-c', 'branch=`git rev-parse --abbrev-ref HEAD`;for i in `git remote`; do git pull $i $branch; done;']
, { cwd: repo, title: 'pull all origins for ' + repo }]
}
// var pullCmd = ['pullall', [], { cwd : repo }]
if (useGitPull) pullCmd = ['git', ['pull'], {
inherit: true, shell: true,
@@ -83,10 +90,10 @@ var getPullCmd = (repo) => {
return pullCmd
}

var performPull = (repo) => {
var performPull = (repo, branch) => {
if (existsSync(instanceroot + '/' + repo)) {
console.log('pulling ' + instanceroot + '/' + repo)
return nodeShellExec.apply(null, getPullCmd(repo)).then(() => {
console.log('pulling ' + instanceroot + '/' + repo + 'branch ' + branch)
return nodeShellExec.apply(null, getPullCmd(repo, branch)).then(() => {
if (__isElevated) {
fs.writeFileSync('run.log', ', ' + JSON.stringify({ repo, success: true }), { 'flag': 'a+' })
}
@@ -636,9 +643,9 @@ var op = {
// console.dir(env)
console.log('Running exlr pull : ' + path.dirname(__dirname))

if (!processedArgs.runas) gitRepos.forEach(performPull)
if (!processedArgs.runas) gitRepos.map((repo) => performPull(repo, 'master'))
if (__isElevated) {
return any(elevatedRunasRepos.map((repo) => performPull(repo))).then(() => {
return any(elevatedRunasRepos.map((repo) => performPull(repo, 'master'))).then(() => {
fs.writeFileSync('run.done', 'success')
}).catch(() => {
fs.writeFileSync('run.done', 'error')

読み込み中…
キャンセル
保存