Skip to content

Commit

Permalink
Align device info fields with themselves & prev version
Browse files Browse the repository at this point in the history
  • Loading branch information
pimterry committed Dec 30, 2024
1 parent 0f5a91d commit f9fec02
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ const execAsync = promisify(exec);

import { logError } from './errors';

export async function getDeviceDetails() {
export async function getDeviceDetails(): Promise<{
platform: string;
release: string;
runtimeArch: string;
realArch: string;
}> {
const [
realArch,
osDetails
Expand All @@ -33,7 +38,7 @@ async function getOsDetails() {
// For Windows, the version numbers are oddly precise and weird. We simplify:
return {
platform: rawPlatform,
version: getWindowsVersion()
release: getWindowsVersion()
};
} else {
return {
Expand Down Expand Up @@ -81,13 +86,13 @@ async function getLinuxOsDetails() {

return {
platform: osRelease['ID'] || osRelease['NAME'] || 'linux',
version: majorMinorOnly(osRelease['VERSION_ID'] || os.release())
release: majorMinorOnly(osRelease['VERSION_ID'] || os.release())
};
} catch (e) {
logError(`Failed to detect Linux version: ${e.message}`);
return {
platform: 'linux',
version: majorMinorOnly(os.release())
release: majorMinorOnly(os.release())
};
}
}
Expand Down

0 comments on commit f9fec02

Please sign in to comment.