Skip to content

Commit

Permalink
Revert "add exe to syft tool name in one place"
Browse files Browse the repository at this point in the history
This reverts commit bd5d548.
  • Loading branch information
willmurphyscode committed Nov 7, 2023
1 parent bd5d548 commit d1e41de
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 13 deletions.
10 changes: 7 additions & 3 deletions dist/attachReleaseAssets/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions dist/downloadSyft/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions dist/runSyftAction/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions src/github/SyftGithubAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ import {
import { downloadSyftFromZip } from "./SyftDownloader";
import { stringify } from "./Util";

export const SYFT_BINARY_NAME =
"syft" + (process.platform == "win32" ? ".exe" : "");
export const SYFT_BINARY_NAME = "syft";
export const SYFT_VERSION = core.getInput("syft-version") || VERSION;

const PRIOR_ARTIFACT_ENV_VAR = "ANCHORE_SBOM_ACTION_PRIOR_ARTIFACT";
Expand Down Expand Up @@ -206,14 +205,18 @@ export async function downloadSyft(): Promise<string> {

await execute("sh", [installPath, "-d", "-b", syftBinaryPath, version]);

return path.join(`${syftBinaryPath}`, `${name}`);
const installedPath = path.join(`${syftBinaryPath}`, `${name}`);
if (process.platform === "win32") {
return `${installedPath}.exe`;
}
return installedPath;
}

/**
* Gets the Syft command to run via exec
*/
export async function getSyftCommand(): Promise<string> {
const name = SYFT_BINARY_NAME;
const name = SYFT_BINARY_NAME + (process.platform == "win32" ? ".exe" : "");
const version = SYFT_VERSION;

const sourceSyft = await downloadSyftFromZip(version);
Expand Down

0 comments on commit d1e41de

Please sign in to comment.