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