diff --git a/dist/attachReleaseAssets/index.js b/dist/attachReleaseAssets/index.js index d47c595a..e6aeb935 100644 --- a/dist/attachReleaseAssets/index.js +++ b/dist/attachReleaseAssets/index.js @@ -23954,7 +23954,7 @@ const Executor_1 = __nccwpck_require__(644); const GithubClient_1 = __nccwpck_require__(8552); const SyftDownloader_1 = __nccwpck_require__(9344); const Util_1 = __nccwpck_require__(2590); -exports.SYFT_BINARY_NAME = "syft"; +exports.SYFT_BINARY_NAME = "syft" + (process.platform == "win32" ? ".exe" : ""); exports.SYFT_VERSION = core.getInput("syft-version") || SyftVersion_1.VERSION; const PRIOR_ARTIFACT_ENV_VAR = "ANCHORE_SBOM_ACTION_PRIOR_ARTIFACT"; const tempDir = fs.mkdtempSync(path_1.default.join(os_1.default.tmpdir(), "sbom-action-")); @@ -24111,11 +24111,7 @@ function downloadSyft() { // Make sure the tool's executable bit is set const syftBinaryPath = `${installPath}_${name}`; yield (0, Executor_1.execute)("sh", [installPath, "-d", "-b", syftBinaryPath, version]); - const installedPath = path_1.default.join(`${syftBinaryPath}`, `${name}`); - if (process.platform === "win32") { - return `${installedPath}.exe`; - } - return installedPath; + return path_1.default.join(`${syftBinaryPath}`, `${name}`); }); } exports.downloadSyft = downloadSyft; @@ -24124,7 +24120,7 @@ exports.downloadSyft = downloadSyft; */ function getSyftCommand() { return __awaiter(this, void 0, void 0, function* () { - const name = exports.SYFT_BINARY_NAME + (process.platform == "win32" ? ".exe" : ""); + const name = exports.SYFT_BINARY_NAME; const version = exports.SYFT_VERSION; const sourceSyft = yield (0, SyftDownloader_1.downloadSyftFromZip)(version); if (sourceSyft) { diff --git a/dist/downloadSyft/index.js b/dist/downloadSyft/index.js index 8aff83f9..6e4bd166 100644 --- a/dist/downloadSyft/index.js +++ b/dist/downloadSyft/index.js @@ -24002,7 +24002,7 @@ const Executor_1 = __nccwpck_require__(644); const GithubClient_1 = __nccwpck_require__(8552); const SyftDownloader_1 = __nccwpck_require__(9344); const Util_1 = __nccwpck_require__(2590); -exports.SYFT_BINARY_NAME = "syft"; +exports.SYFT_BINARY_NAME = "syft" + (process.platform == "win32" ? ".exe" : ""); exports.SYFT_VERSION = core.getInput("syft-version") || SyftVersion_1.VERSION; const PRIOR_ARTIFACT_ENV_VAR = "ANCHORE_SBOM_ACTION_PRIOR_ARTIFACT"; const tempDir = fs.mkdtempSync(path_1.default.join(os_1.default.tmpdir(), "sbom-action-")); @@ -24159,11 +24159,7 @@ function downloadSyft() { // Make sure the tool's executable bit is set const syftBinaryPath = `${installPath}_${name}`; yield (0, Executor_1.execute)("sh", [installPath, "-d", "-b", syftBinaryPath, version]); - const installedPath = path_1.default.join(`${syftBinaryPath}`, `${name}`); - if (process.platform === "win32") { - return `${installedPath}.exe`; - } - return installedPath; + return path_1.default.join(`${syftBinaryPath}`, `${name}`); }); } exports.downloadSyft = downloadSyft; @@ -24172,7 +24168,7 @@ exports.downloadSyft = downloadSyft; */ function getSyftCommand() { return __awaiter(this, void 0, void 0, function* () { - const name = exports.SYFT_BINARY_NAME + (process.platform == "win32" ? ".exe" : ""); + const name = exports.SYFT_BINARY_NAME; const version = exports.SYFT_VERSION; const sourceSyft = yield (0, SyftDownloader_1.downloadSyftFromZip)(version); if (sourceSyft) { diff --git a/dist/runSyftAction/index.js b/dist/runSyftAction/index.js index f5d840ff..a152d470 100644 --- a/dist/runSyftAction/index.js +++ b/dist/runSyftAction/index.js @@ -23954,7 +23954,7 @@ const Executor_1 = __nccwpck_require__(644); const GithubClient_1 = __nccwpck_require__(8552); const SyftDownloader_1 = __nccwpck_require__(9344); const Util_1 = __nccwpck_require__(2590); -exports.SYFT_BINARY_NAME = "syft"; +exports.SYFT_BINARY_NAME = "syft" + (process.platform == "win32" ? ".exe" : ""); exports.SYFT_VERSION = core.getInput("syft-version") || SyftVersion_1.VERSION; const PRIOR_ARTIFACT_ENV_VAR = "ANCHORE_SBOM_ACTION_PRIOR_ARTIFACT"; const tempDir = fs.mkdtempSync(path_1.default.join(os_1.default.tmpdir(), "sbom-action-")); @@ -24111,11 +24111,7 @@ function downloadSyft() { // Make sure the tool's executable bit is set const syftBinaryPath = `${installPath}_${name}`; yield (0, Executor_1.execute)("sh", [installPath, "-d", "-b", syftBinaryPath, version]); - const installedPath = path_1.default.join(`${syftBinaryPath}`, `${name}`); - if (process.platform === "win32") { - return `${installedPath}.exe`; - } - return installedPath; + return path_1.default.join(`${syftBinaryPath}`, `${name}`); }); } exports.downloadSyft = downloadSyft; @@ -24124,7 +24120,7 @@ exports.downloadSyft = downloadSyft; */ function getSyftCommand() { return __awaiter(this, void 0, void 0, function* () { - const name = exports.SYFT_BINARY_NAME + (process.platform == "win32" ? ".exe" : ""); + const name = exports.SYFT_BINARY_NAME; const version = exports.SYFT_VERSION; const sourceSyft = yield (0, SyftDownloader_1.downloadSyftFromZip)(version); if (sourceSyft) { diff --git a/src/github/SyftGithubAction.ts b/src/github/SyftGithubAction.ts index 60e15daf..626405fc 100644 --- a/src/github/SyftGithubAction.ts +++ b/src/github/SyftGithubAction.ts @@ -22,7 +22,8 @@ import { import { downloadSyftFromZip } from "./SyftDownloader"; import { stringify } from "./Util"; -export const SYFT_BINARY_NAME = "syft"; +export const SYFT_BINARY_NAME = + "syft" + (process.platform == "win32" ? ".exe" : ""); export const SYFT_VERSION = core.getInput("syft-version") || VERSION; const PRIOR_ARTIFACT_ENV_VAR = "ANCHORE_SBOM_ACTION_PRIOR_ARTIFACT"; @@ -205,18 +206,14 @@ export async function downloadSyft(): Promise { await execute("sh", [installPath, "-d", "-b", syftBinaryPath, version]); - const installedPath = path.join(`${syftBinaryPath}`, `${name}`); - if (process.platform === "win32") { - return `${installedPath}.exe`; - } - return installedPath; + return path.join(`${syftBinaryPath}`, `${name}`); } /** * Gets the Syft command to run via exec */ export async function getSyftCommand(): Promise { - const name = SYFT_BINARY_NAME + (process.platform == "win32" ? ".exe" : ""); + const name = SYFT_BINARY_NAME; const version = SYFT_VERSION; const sourceSyft = await downloadSyftFromZip(version);