From f10cb5f53e124bcd5999bad28446867953011c85 Mon Sep 17 00:00:00 2001 From: Benji Visser Date: Mon, 30 Jan 2023 11:14:31 -0700 Subject: [PATCH] adding --fail-on-eol-found Signed-off-by: Benji Visser --- dist/index.js | 3 +++ index.js | 3 +++ tests/xeol_command.test.js | 10 ++++++++++ 3 files changed, 16 insertions(+) diff --git a/dist/index.js b/dist/index.js index 7271f99..d987f9c 100644 --- a/dist/index.js +++ b/dist/index.js @@ -175,6 +175,9 @@ async function runScan({ // Run the xeol analyzer let cmdOutput = ""; let cmd = `${xeolBinary}`; + if (failBuild) { + cmdArgs.push("--fail-on-eol-found"); + } cmdArgs.push(source); // This /dev/null writable stream is required so the entire Xeol output diff --git a/index.js b/index.js index a900373..56e55e4 100644 --- a/index.js +++ b/index.js @@ -161,6 +161,9 @@ async function runScan({ // Run the xeol analyzer let cmdOutput = ""; let cmd = `${xeolBinary}`; + if (failBuild) { + cmdArgs.push("--fail-on-eol-found"); + } cmdArgs.push(source); // This /dev/null writable stream is required so the entire Xeol output diff --git a/tests/xeol_command.test.js b/tests/xeol_command.test.js index fbb394e..a7a1fc3 100644 --- a/tests/xeol_command.test.js +++ b/tests/xeol_command.test.js @@ -43,4 +43,14 @@ describe("Xeol command", () => { }); expect(cmd).toBe("xeol -o json asdf"); }); + + it("is invoked with fail", async () => { + let cmd = await mockExec({ + source: "asdf", + failBuild: "true", + outputFormat: "json", + version: "0.6.0", + }); + expect(cmd).toBe("xeol -o json --fail-on-eol-found asdf"); + }); });