forked from microsoft/vscode-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplatform.ts
More file actions
29 lines (26 loc) · 677 Bytes
/
platform.ts
File metadata and controls
29 lines (26 loc) · 677 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
'use strict';
export enum Architecture {
Unknown = 1,
x86 = 2,
x64 = 3
}
export enum OSType {
Unknown = 'Unknown',
Windows = 'Windows',
OSX = 'OSX',
Linux = 'Linux'
}
// Return the OS type for the given platform string.
export function getOSType(platform: string = process.platform): OSType {
if (/^win/.test(platform)) {
return OSType.Windows;
} else if (/^darwin/.test(platform)) {
return OSType.OSX;
} else if (/^linux/.test(platform)) {
return OSType.Linux;
} else {
return OSType.Unknown;
}
}