From 27e02a75e91b0e0daef14808ba2168b0323b99f6 Mon Sep 17 00:00:00 2001 From: Florian Friedrich Date: Mon, 24 Oct 2022 13:02:48 +0200 Subject: [PATCH] Cleanup --- src/main.ts | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/main.ts b/src/main.ts index d722fb1..d484dc0 100644 --- a/src/main.ts +++ b/src/main.ts @@ -68,7 +68,7 @@ function argumentStrings(argument: ICommandArgument, useResolvedValue: boolean = true, escapeValue: boolean = false): string[] { let plain = [argument.name]; - if (argument.value) plain.push(argumentValueString(argument.value, useResolvedValue, escapeValue)); + if (argument.value) plain.push(argumentValueString(argument.value, useResolvedValue, escapeValue)); return plain; } @@ -84,7 +84,9 @@ interface IXcPrettyInvocation { async function runXcodebuild(args: ICommandArgument[], xcprettyInv?: IXcPrettyInvocation | null) { const xcodebuildOut: StdioNull | StdioPipe = xcprettyInv ? 'pipe' : process.stdout; - const xcodebuild = spawn('xcodebuild', allArgumentStrings(args), { stdio: ['inherit', xcodebuildOut, process.stderr] }); + const xcodebuild = spawn('xcodebuild', allArgumentStrings(args), { + stdio: ['inherit', xcodebuildOut, process.stderr], + }); let finishedPromise = new Promise((resolve, reject) => { xcodebuild.on('error', reject); xcodebuild.on('exit', (exitCode, signal) => { @@ -96,7 +98,9 @@ async function runXcodebuild(args: ICommandArgument[], xcprettyInv?: IXcPrettyIn }); }); if (xcprettyInv) { - const xcpretty = spawn('xcpretty', allArgumentStrings(xcprettyInv.args), { stdio: ['pipe', process.stdout, process.stderr] }); + const xcpretty = spawn('xcpretty', allArgumentStrings(xcprettyInv.args), { + stdio: ['pipe', process.stdout, process.stderr], + }); xcodebuild.stdout?.pipe(xcpretty.stdin); finishedPromise = finishedPromise.then((xcodeCode) => new Promise((resolve, reject) => { xcpretty.on('error', reject); @@ -131,7 +135,7 @@ async function main() { || (workspace && project) || (workspace && spmPackage) || (project && spmPackage)) { - throw new Error("Either `project`, `workspace` or `spm-package-path` must be set, but they are mutually exclusive!"); + throw new Error('Either `project`, `workspace` or `spm-package-path` must be set, but they are mutually exclusive!'); } const scheme = core.getInput('scheme', { required: !!workspace || !!spmPackage }); @@ -157,14 +161,14 @@ async function main() { if (values) values.forEach(value => _pushArgWithValue(argName ?? inputName, value, { isPath: opts?.isPath, - skipEmptyValues: true + skipEmptyValues: true, })); } else { let value = core.getInput(inputName); if (value) _pushArgWithValue(argName ?? inputName, value, { isPath: opts?.isPath, - skipEmptyValues: false + skipEmptyValues: false, }) } }