Browse Source

continue on error

pull/1/head
Pradeep Bhaskaran 4 years ago
parent
commit
f392b54f14
1 changed files with 6 additions and 3 deletions
  1. 6
    3
      index.js

+ 6
- 3
index.js View File

, inherit : true, shell: true , inherit : true, shell: true
, env: process.env , env: process.env
}] }]
, ['git', ['remote', 'rename', 'origin', 'githubclone'], { cwd : `${repo}`}] // PB ; Todo -- new repositories created locally will not have origin. Handle this failure.
, ['git', ['remote', 'rename', 'origin', 'githubclone'], { cwd : `${repo}`}, (err)=>{
console.log('Ignoring origin rename error : ' + err); return true; //return true to continue.
} ] // PB ; Todo -- new repositories created locally will not have origin. Handle this failure.
, ['git', ['remote', 'add', 'origin', `${defaultRepoServer}/${repo}.git`], { cwd : `${repo}`}] , ['git', ['remote', 'add', 'origin', `${defaultRepoServer}/${repo}.git`], { cwd : `${repo}`}]
] ]
if(!existsSync(`Z:`)){ if(!existsSync(`Z:`)){
// throw 'done' // throw 'done'
} }
} }
sequentialTaskShellCommands.push(['git', ['push', 'origin', 'master'], { cwd : `${repo}`}]) sequentialTaskShellCommands.push(['git', ['push', 'origin', 'master'], { cwd : `${repo}`}])
// console.dir(sequentialTaskShellCommands); // console.dir(sequentialTaskShellCommands);


sequentialTaskShellCommands.forEach(shellcmd => { sequentialTaskShellCommands.forEach(shellcmd => {
// console.log(shellcmd) // console.log(shellcmd)
tasks.push(()=>{ tasks.push(()=>{
var p = nodeShellExec.apply(null, shellcmd).catch((e)=>{ console.error(e) })
var p = nodeShellExec.apply(null, shellcmd.slice(0,3)).catch((e)=>{ if(shellcmd[3]) { return shellcmd[3]() } else { console.error(e);} })
return p; return p;
}) })
}) })

Loading…
Cancel
Save