mirror of https://github.com/aminya/setup-cpp
15 lines
299 B
TypeScript
15 lines
299 B
TypeScript
|
import which from "which"
|
||
|
|
||
|
let hasDnfCache: undefined | boolean = undefined
|
||
|
|
||
|
export function hasDnf(): boolean {
|
||
|
if (process.platform !== "linux") {
|
||
|
return false
|
||
|
}
|
||
|
if (hasDnfCache === undefined) {
|
||
|
hasDnfCache = which.sync("dnf", { nothrow: true }) !== null
|
||
|
}
|
||
|
|
||
|
return hasDnfCache
|
||
|
}
|