mirror of https://github.com/aminya/setup-cpp
fix: skip choco installation on non-windows
This commit is contained in:
parent
b085463827
commit
649aac71b9
|
@ -5,6 +5,9 @@ jest.setTimeout(100000)
|
||||||
|
|
||||||
describe("setup-chocolatey", () => {
|
describe("setup-chocolatey", () => {
|
||||||
it("should setup chocolatey", async () => {
|
it("should setup chocolatey", async () => {
|
||||||
|
if (process.platform !== "win32") {
|
||||||
|
return
|
||||||
|
}
|
||||||
await setupChocolatey()
|
await setupChocolatey()
|
||||||
|
|
||||||
const { status } = spawn("choco", ["--version"], {
|
const { status } = spawn("choco", ["--version"], {
|
|
@ -2,6 +2,10 @@ import { exec } from "@actions/exec"
|
||||||
import which from "which"
|
import which from "which"
|
||||||
|
|
||||||
export async function setupChocolatey() {
|
export async function setupChocolatey() {
|
||||||
|
if (process.platform !== "win32") {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if (which.sync("choco", { nothrow: true }) !== null) {
|
if (which.sync("choco", { nothrow: true }) !== null) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue