Browse Source

Fixed error with duplicate messages

production
Pradeep Bhaskaran 4 years ago
parent
commit
2f59895723
1 changed files with 14 additions and 7 deletions
  1. 14
    7
      index.js

+ 14
- 7
index.js View File

@@ -304,10 +304,16 @@ var __runcmd = function(label){
}
).then(()=>{
// runas returned.
var runaslog = JSON.parse('[ { "success" : true, "result" : "runas Log" }' + fs.readFileSync('run.log', { flags : 'a+'}) + ']');
runaslog.forEach((logEntry)=>{
logEntry.success ? (console.log(['success :' + logEntry.result]), console.log((logEntry.messages || []).join(' '))) : console.error(['error :' + logEntry.result]), console.error((logEntry.messages || []).join(' '))
})
try {
var runaslog = JSON.parse('[ { "success" : true, "result" : "runas Log" }' + fs.readFileSync('run.log', { flags : 'a+'}) + ']');
runaslog.forEach((logEntry)=>{
logEntry.success ? (console.log(['success :' + logEntry.result]), console.log((logEntry.messages || []).join(' '))) : (console.error(['error :' + logEntry.result]), console.error((logEntry.messages || []).join(' ')))
})
}
catch(e){
// Ignore nonexistent log
console.warn('Run log error probably was not created by runas : ' + e)
}
})
.catch(err => console.error('Elevation failed : ' + err));
})
@@ -591,8 +597,9 @@ var __runcmd = function(label){
var performCheckout = (repo)=>{
if(excludeCheckouts[repo]) return Promise.resolve({ 'skipped' : true })
return nodeShellExec('git', ['switch', '-m', '-C', checkoutMap[runconfig.NODE_ENV] || runconfig.NODE_ENV], {
inherit : true, shell: true,
// inherit : true, shell: true,
cwd : repo
// , stdio : ignore // Use when we want to silcence output completely.
, runas : processedArgs.runas
, title : `git switch -C -m ${checkoutMap[runconfig.NODE_ENV] || runconfig.NODE_ENV} for ${repo}`
}).catch((e)=>{ console.error(e); return { error : true, message : repo} })
@@ -601,10 +608,10 @@ var __runcmd = function(label){
var performPullAll = (repo)=>{
if(excludeCheckouts[repo]) return Promise.resolve({ 'skipped' : true })
return nodeShellExec('git', ['pull', '--all'], {
inherit : true, shell: true,
// inherit : true, shell: true,
cwd : repo
, runas : processedArgs.runas
, title : `git switch -C -m ${checkoutMap[runconfig.NODE_ENV] || runconfig.NODE_ENV} for ${repo}`
, title : `git pull -all for ${checkoutMap[runconfig.NODE_ENV] || runconfig.NODE_ENV} ${repo}`
}).catch((e)=>{ console.error(e); return { error : true, message : repo} })
}


Loading…
Cancel
Save