| , 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; | ||||
| }) | }) | ||||
| }) | }) |