Skip to content

Commit

Permalink
backend: fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
soumyaDghosh committed Nov 3, 2024
1 parent 3b3bc05 commit 46c2ec2
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/backend/utils/systeminfo/osInfo/linux.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ function stripQuotes(stringMaybeWithQuotes: string): string {

async function osInfo_linux(): Promise<{ name: string; version?: string }> {
let os_release_path: string | null = null
for (const potPath of ['/run/host/os-release', '/var/lib/snapd/hostfs/etc/os-release', '/etc/os-release']) {
for (const potPath of [
'/run/host/os-release',
'/var/lib/snapd/hostfs/etc/os-release',
'/etc/os-release'
]) {
try {
await stat(potPath)
os_release_path = potPath
Expand All @@ -41,13 +45,13 @@ async function osInfo_linux(): Promise<{ name: string; version?: string }> {
const osName = nameMatch
? stripQuotes(nameMatch)
: prettyNameMatch
? stripQuotes(prettyNameMatch)
: 'Linux'
? stripQuotes(prettyNameMatch)
: 'Linux'
const osVersion = versionMatch
? stripQuotes(versionMatch)
: versionId && versionCodename
? `${versionId} ${versionCodename}`
: undefined
? `${versionId} ${versionCodename}`
: undefined
if (osVersion) return { name: osName, version: osVersion }
return { name: osName }
}
Expand Down

0 comments on commit 46c2ec2

Please sign in to comment.