2024-01-01 14:58:21 -05:00
|
|
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2023-02-14 11:38:45 -05:00
|
|
|
|
2023-12-08 04:00:03 -05:00
|
|
|
import { core } from "ext:core/mod.js";
|
2024-01-10 17:37:25 -05:00
|
|
|
const {
|
|
|
|
op_node_build_os,
|
|
|
|
} = core.ensureFastOps(true);
|
2023-02-14 11:38:45 -05:00
|
|
|
|
2024-01-10 08:04:14 -05:00
|
|
|
export type OSType =
|
|
|
|
| "windows"
|
|
|
|
| "linux"
|
|
|
|
| "android"
|
|
|
|
| "darwin"
|
|
|
|
| "freebsd"
|
|
|
|
| "openbsd";
|
2023-02-14 11:38:45 -05:00
|
|
|
|
2024-01-10 17:37:25 -05:00
|
|
|
export const osType: OSType = op_node_build_os();
|
2023-02-14 11:38:45 -05:00
|
|
|
|
|
|
|
export const isWindows = osType === "windows";
|
2024-01-10 08:04:14 -05:00
|
|
|
export const isLinux = osType === "linux" || osType === "android";
|