| else { | else { | ||||
| var t2 = function(){ | var t2 = function(){ | ||||
| return performPull(def).then(() => { | return performPull(def).then(() => { | ||||
| console.log('pulled ' + JSON.stringify(def.repo)) | |||||
| return true; | return true; | ||||
| }).catch((e) => { | }).catch((e) => { | ||||
| console.error(e) | console.error(e) | ||||
| if(def.repos) { | if(def.repos) { | ||||
| var regularpulltasks = function(){ | var regularpulltasks = function(){ | ||||
| var pendingpulls = []; | var pendingpulls = []; | ||||
| def.repos.forEach((def) => { pendingpulls.push(performPull(def)) }) | |||||
| return Promise.all(pendingpulls).finally(Traq.finally) | |||||
| def.repos.forEach((def) => { | |||||
| pendingpulls.push( | |||||
| performPull(def).then(()=>{ console.log('pulled ' + JSON.stringify(def.repo)) }) | |||||
| .catch(e => { console.log(e); throw e }) | |||||
| ) | |||||
| }) | |||||
| return any(pendingpulls).finally(Traq.finally) | |||||
| } | } | ||||
| regularpulltasks.statuslog = statuslog | regularpulltasks.statuslog = statuslog | ||||
| } | } | ||||
| }) | }) | ||||
| }) | }) | ||||
| }) | }) | ||||
| // .then( () => { | |||||
| // console.log(process._getActiveHandles()); | |||||
| // console.log(process._getActiveRequests()); | |||||
| // }) | |||||
| // detect if alread installed -> Take no action. | // detect if alread installed -> Take no action. | ||||
| // download if no installer avalable -> next() | // download if no installer avalable -> next() |