Skip to content

Commit ec892f2

Browse files
committed
Ignore 'os-release' IDs with surrounding quotes
On an ubuntu machine, it shows up like: ID=ubuntu But on an almalinux machine, it shows up like: ID="almalinux" The additional surrounding quotes are causing it to be unidentified, falling back to ubuntu, and then it tries to "apt-get install" dependencies.
1 parent c02a7a6 commit ec892f2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/helpers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export const getValidatedInput = (key, re) => {
7575
export const getLinuxDistro = async () => {
7676
try {
7777
const osRelease = await fs.promises.readFile("/etc/os-release")
78-
const match = osRelease.toString().match(/^ID=(.*)$/m)
78+
const match = osRelease.toString().match(/^ID=(?:\W)?(\w*)(?:\W)?$/m)
7979
return match ? match[1] : "(unknown)"
8080
} catch (e) {
8181
return "(unknown)"

0 commit comments

Comments
 (0)