mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-21 07:16:17 -04:00
ESM: Added new List<File> Dish type. Added present() method for displaying operation output in a nice way. Testing required.
This commit is contained in:
parent
ae55fde591
commit
b7ed1becba
8 changed files with 165 additions and 69 deletions
|
@ -130,7 +130,7 @@ class Recipe {
|
|||
* - The final progress through the recipe
|
||||
*/
|
||||
async execute(dish, startFrom=0, forkState={}) {
|
||||
let op, input, output,
|
||||
let op, input, output, lastRunOp,
|
||||
numJumps = 0,
|
||||
numRegisters = forkState.numRegisters || 0;
|
||||
|
||||
|
@ -149,7 +149,7 @@ class Recipe {
|
|||
}
|
||||
|
||||
try {
|
||||
input = dish.get(op.inputType);
|
||||
input = await dish.get(op.inputType);
|
||||
log.debug("Executing operation");
|
||||
|
||||
if (op.flowControl) {
|
||||
|
@ -169,6 +169,7 @@ class Recipe {
|
|||
numRegisters = state.numRegisters;
|
||||
} else {
|
||||
output = await op.run(input, op.ingValues);
|
||||
lastRunOp = op;
|
||||
dish.set(output, op.outputType);
|
||||
}
|
||||
} catch (err) {
|
||||
|
@ -187,6 +188,11 @@ class Recipe {
|
|||
}
|
||||
}
|
||||
|
||||
// Present the results of the final operation
|
||||
// TODO try/catch
|
||||
output = await lastRunOp.present(output);
|
||||
dish.set(output, lastRunOp.presentType);
|
||||
|
||||
log.debug("Recipe complete");
|
||||
return this.opList.length;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue