Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita37a192

Browse files
committed
add os platform validation
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
1 parent2265445 commita37a192

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

‎src/environment.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,18 @@ export const SENTRY_DSN: string | null = process.env.SENTRY_DSN || null
2323
// uri path to the users project workspace
2424
exportconstWORKSPACE_ROOT:string=getWorkspaceRoot()
2525

26-
// Possible values are 'aix', 'darwin', 'freebsd', 'linux', 'openbsd', 'sunos', and 'win32'.
26+
// Possible values are: 'aix', 'darwin', 'freebsd', 'linux', 'openbsd', 'sunos', and 'win32'.
27+
// The value 'android' may also be returned if Node.js is built on the Android operating system. Android support is experimental.
2728
//@ts-ignore
28-
exportconstOS_PLATFORM:'win32'|'linux'=os.platform()
29+
exportconstOS_PLATFORM:'win32'|'linux'|'darwin'=os.platform()
30+
31+
constsupportedOS=[
32+
'win32',// windows
33+
'darwin',// macos
34+
'linux',
35+
// 'android' // TODO: validate support
36+
]
37+
38+
if(!supportedOS.includes(OS_PLATFORM)){
39+
thrownewError(`OS${OS_PLATFORM}" not supported with CodeRoad`)
40+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp