// shell_verse.getElevatedTask( t1 ) | // shell_verse.getElevatedTask( t1 ) | ||||
var eBatch = [] | var eBatch = [] | ||||
def.elevated.map((def) => getPullTask(def, null, null, null, eBatch)) | def.elevated.map((def) => getPullTask(def, null, null, null, eBatch)) | ||||
return shell_verse.runElevated(eBatch).then(() => { | |||||
return any(shell_verse.runElevatedBatch(eBatch)).then(() => { | |||||
return true; | return true; | ||||
}).catch((e) => { | }).catch((e) => { | ||||
console.error(e) | console.error(e) |
return shell_verse.requestElevation(shell_verse.elevatedRunner, taskToRun) | return shell_verse.requestElevation(shell_verse.elevatedRunner, taskToRun) | ||||
} | } | ||||
} | } | ||||
, runElevatedBatch( batchToRun ){ | |||||
// In windows we don't need to run each task. We hand over to another shell which in elevated state rebuilds the whole batch and runs. | |||||
// Irrespective of the batch we just call runElevated once. | |||||
return batchToRun.map( t => runElevated ) | |||||
} | |||||
, getNonElevatedTask : function( taskToRun ){ return ()=>{ return shell_verse.runNonElevated(taskToRun) } } | , getNonElevatedTask : function( taskToRun ){ return ()=>{ return shell_verse.runNonElevated(taskToRun) } } | ||||
, runNonElevated : ( taskToRun ) => { | , runNonElevated : ( taskToRun ) => { |
, runElevatedBatch( batchToRun ){ | , runElevatedBatch( batchToRun ){ | ||||
// In windows we don't need to run each task. We hand over to another shell which in elevated state rebuilds the whole batch and runs. | // In windows we don't need to run each task. We hand over to another shell which in elevated state rebuilds the whole batch and runs. | ||||
// Irrespective of the batch we just call runElevated once. | // Irrespective of the batch we just call runElevated once. | ||||
return runElevated(batchToRun[0]) | |||||
return [runElevated(batchToRun[0])] | |||||
} | } | ||||
, getNonElevatedTask : function( taskToRun ){ return ()=>{ return shell_verse.runNonElevated(taskToRun) } } | , getNonElevatedTask : function( taskToRun ){ return ()=>{ return shell_verse.runNonElevated(taskToRun) } } |