Sfoglia il codice sorgente

Fixed error with duplicate messages

master
Pradeep Bhaskaran 4 anni fa
parent
commit
2f59895723
1 ha cambiato i file con 14 aggiunte e 7 eliminazioni
  1. 14
    7
      index.js

+ 14
- 7
index.js Vedi 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…
Annulla
Salva