experimental pre-post hooks

pull/310/head
Frostebite 2022-01-01 18:06:46 +00:00
parent ab042e9a9e
commit 9f51fedcc0
3 changed files with 23 additions and 12 deletions

15
dist/index.js vendored
View File

@ -2688,13 +2688,18 @@ class TaskParameterSerializer {
let array = new Array(); let array = new Array();
array = TaskParameterSerializer.readBuildParameters(array); array = TaskParameterSerializer.readBuildParameters(array);
array = TaskParameterSerializer.readInput(array); array = TaskParameterSerializer.readInput(array);
const configurableHooks = cloud_runner_build_command_process_1.CloudRunnerBuildCommandProcessor.getHooks() const configurableHooks = cloud_runner_build_command_process_1.CloudRunnerBuildCommandProcessor.getHooks();
const secrets = configurableHooks
.map((x) => x.secrets) .map((x) => x.secrets)
.map((z) => z.length > 1
? z
.map((x) => [x])
// eslint-disable-next-line unicorn/no-array-reduce // eslint-disable-next-line unicorn/no-array-reduce
.reduce((x, y) => .reduce((x, y) => [...x, ...y])
// eslint-disable-next-line unicorn/prefer-spread : z)
x.concat(y)); // eslint-disable-next-line unicorn/no-array-reduce
array.push(configurableHooks); .reduce((x, y) => [...x, ...y]);
array.push(secrets);
array = array.filter((x) => x.value !== undefined && x.name !== '0' && x.value !== '' && x.name !== 'prototype' && x.name !== 'length'); array = array.filter((x) => x.value !== undefined && x.name !== '0' && x.value !== '' && x.name !== 'prototype' && x.name !== 'length');
array = array.map((x) => { array = array.map((x) => {
x.name = __1.Input.ToEnvVarFormat(x.name); x.name = __1.Input.ToEnvVarFormat(x.name);

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -27,14 +27,20 @@ export class TaskParameterSerializer {
let array = new Array(); let array = new Array();
array = TaskParameterSerializer.readBuildParameters(array); array = TaskParameterSerializer.readBuildParameters(array);
array = TaskParameterSerializer.readInput(array); array = TaskParameterSerializer.readInput(array);
const configurableHooks = CloudRunnerBuildCommandProcessor.getHooks() const configurableHooks = CloudRunnerBuildCommandProcessor.getHooks();
const secrets = configurableHooks
.map((x) => x.secrets) .map((x) => x.secrets)
.map((z) =>
z.length > 1
? z
.map((x) => [x])
// eslint-disable-next-line unicorn/no-array-reduce // eslint-disable-next-line unicorn/no-array-reduce
.reduce((x, y) => .reduce((x, y) => [...x, ...y])
// eslint-disable-next-line unicorn/prefer-spread : z,
x.concat(y), )
); // eslint-disable-next-line unicorn/no-array-reduce
array.push(configurableHooks); .reduce((x, y) => [...x, ...y]);
array.push(secrets);
array = array.filter( array = array.filter(
(x) => x.value !== undefined && x.name !== '0' && x.value !== '' && x.name !== 'prototype' && x.name !== 'length', (x) => x.value !== undefined && x.name !== '0' && x.value !== '' && x.name !== 'prototype' && x.name !== 'length',