diff --git a/src/chocolatey/__tests__/conan.test.ts b/src/chocolatey/__tests__/chocolatey.test.ts similarity index 85% rename from src/chocolatey/__tests__/conan.test.ts rename to src/chocolatey/__tests__/chocolatey.test.ts index e52516be..b6ba4329 100644 --- a/src/chocolatey/__tests__/conan.test.ts +++ b/src/chocolatey/__tests__/chocolatey.test.ts @@ -5,6 +5,9 @@ jest.setTimeout(100000) describe("setup-chocolatey", () => { it("should setup chocolatey", async () => { + if (process.platform !== "win32") { + return + } await setupChocolatey() const { status } = spawn("choco", ["--version"], { diff --git a/src/chocolatey/chocolatey.ts b/src/chocolatey/chocolatey.ts index 5da8ef88..5f82b707 100644 --- a/src/chocolatey/chocolatey.ts +++ b/src/chocolatey/chocolatey.ts @@ -2,6 +2,10 @@ import { exec } from "@actions/exec" import which from "which" export async function setupChocolatey() { + if (process.platform !== "win32") { + return + } + if (which.sync("choco", { nothrow: true }) !== null) { return }