File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 11import * as vscode from 'vscode' ;
22import * as temp from 'temp' ;
33import * as fs from 'fs' ;
4+ import * as os from 'os' ;
45import { isArray } from 'util' ;
56
67const toastDuration = 5000 ;
@@ -74,3 +75,22 @@ export function toastStatusBarMessage(message: string): void {
7475export function setContext ( context : string , state : boolean ) : void {
7576 vscode . commands . executeCommand ( 'setContext' , context , state ) ;
7677}
78+
79+ /**
80+ * Gets the runtime platform suitable for use in settings lookup.
81+ */
82+ export function getPlatform ( ) : 'windows' | 'osx' | 'linux' | undefined {
83+ let platform : 'windows' | 'osx' | 'linux' | undefined ;
84+ switch ( os . platform ( ) ) {
85+ case 'win32' :
86+ platform = 'windows' ;
87+ break ;
88+ case 'darwin' :
89+ platform = 'osx' ;
90+ break ;
91+ case 'linux' :
92+ platform = 'linux' ;
93+ break ;
94+ }
95+ return platform ;
96+ }
You can’t perform that action at this time.
0 commit comments