mirror of https://github.com/aminya/setup-cpp
fix: fix isCI
This commit is contained in:
parent
bfd6260fca
commit
a0e33e0466
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -15,6 +15,7 @@ import { setupOpencppcoverage } from "./opencppcoverage/opencppcoverage"
|
|||
import { setupPython } from "./python/python"
|
||||
import mri from "mri"
|
||||
import untildify from "untildify"
|
||||
import { isCI } from "./utils/env/isci"
|
||||
|
||||
import semverValid from "semver/functions/valid"
|
||||
import { getVersion } from "./default_versions"
|
||||
|
@ -68,9 +69,7 @@ const inputs: Array<Inputs> = ["compiler", "architecture", ...tools]
|
|||
|
||||
/** The main entry function */
|
||||
export async function main(args: string[]): Promise<number> {
|
||||
const isCI = process.env.CI === undefined || process.env.CI === "" || process.env.CI === "false"
|
||||
|
||||
if (!isCI) {
|
||||
if (!isCI()) {
|
||||
process.env.ACTIONS_ALLOW_UNSECURE_COMMANDS = "true"
|
||||
}
|
||||
|
||||
|
|
|
@ -8,13 +8,14 @@ import { setupBrewPack } from "../utils/setup/setupBrewPack"
|
|||
import { setupChocoPack } from "../utils/setup/setupChocoPack"
|
||||
import hasha from "hasha"
|
||||
import { join } from "path"
|
||||
import { isCI } from "../utils/env/isci"
|
||||
|
||||
function isPyPyVersion(versionSpec: string) {
|
||||
return versionSpec.startsWith("pypy-")
|
||||
}
|
||||
|
||||
export async function setupPython(version: string, setupCppDir: string, arch: string) {
|
||||
if (process.env.CI === undefined || process.env.CI === "" || process.env.CI === "false") {
|
||||
if (!isCI()) {
|
||||
return setupPythonViaSystem(version, setupCppDir, arch)
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
export function isCI() {
|
||||
return !(process.env.CI === undefined || process.env.CI === "" || process.env.CI === "false")
|
||||
}
|
|
@ -1,11 +1,10 @@
|
|||
import * as core from "@actions/core"
|
||||
|
||||
const isCI = process.env.CI === undefined || process.env.CI === "" || process.env.CI === "false"
|
||||
import { isCI } from "../env/isci"
|
||||
|
||||
export function error(err: string | Error) {
|
||||
return isCI ? core.error(err) : console.log(`\x1b[31m${err}\x1b[0m`)
|
||||
return isCI() ? core.error(err) : console.log(`\x1b[31m${err}\x1b[0m`)
|
||||
}
|
||||
|
||||
export function success(msg: string) {
|
||||
return isCI ? core.info(msg) : console.log(`\x1b[32m${msg}\x1b[0m`)
|
||||
return isCI() ? core.info(msg) : console.log(`\x1b[32m${msg}\x1b[0m`)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue