fix: install lsb_release if it is missing on ubuntu

This commit is contained in:
Amin Yahyaabadi 2022-07-27 00:49:07 -07:00
parent 22c47cf64e
commit 0fd405d4e1
5 changed files with 9 additions and 4 deletions

2
dist/setup_cpp.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
dist/setup_cpp.mjs vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,8 +1,13 @@
import { getUbuntuVersion } from "ubuntu-version"
import which from "which"
import { setupAptPack } from "../setup/setupAptPack"
import { isUbuntu } from "./isUbuntu"
export async function ubuntuVersion(): Promise<number[] | null> {
if (isUbuntu()) {
if (which.sync("lsb_release", { nothrow: true }) === null) {
setupAptPack("lsb-release")
}
const versionSplitted = await getUbuntuVersion()
if (versionSplitted.length === 0) {