setup-cpp
Version:
Install all the tools required for building and testing C++/C projects.
16 lines (12 loc) • 333 B
text/typescript
import which from "which"
let isUbuntuCache: undefined | boolean = undefined
export function isUbuntu(): boolean {
if (process.platform !== "linux") {
return false
}
if (isUbuntuCache === undefined) {
const apt = "apt-get"
isUbuntuCache = which.sync(apt, { nothrow: true }) !== null
}
return isUbuntuCache
}