diff --git a/src/environment.ts b/src/environment.ts index 7b731f76..ec7d9b1c 100644 --- a/src/environment.ts +++ b/src/environment.ts @@ -23,6 +23,18 @@ export const SENTRY_DSN: string | null = process.env.SENTRY_DSN || null // uri path to the users project workspace export const WORKSPACE_ROOT: string = getWorkspaceRoot() -// Possible values are 'aix', 'darwin', 'freebsd', 'linux', 'openbsd', 'sunos', and 'win32'. +// Possible values are: 'aix', 'darwin', 'freebsd', 'linux', 'openbsd', 'sunos', and 'win32'. +// The value 'android' may also be returned if Node.js is built on the Android operating system. Android support is experimental. // @ts-ignore -export const OS_PLATFORM: 'win32' | 'linux' = os.platform() +export const OS_PLATFORM: 'win32' | 'linux' | 'darwin' = os.platform() + +const supportedOS = [ + 'win32', // windows + 'darwin', // macos + 'linux', + // 'android' // TODO: validate support +] + +if (!supportedOS.includes(OS_PLATFORM)) { + throw new Error(`OS ${OS_PLATFORM}" not supported with CodeRoad`) +}