diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2020-04-28 12:35:23 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-28 12:35:23 -0400 |
commit | e0ca60e7707b5896ce67301aefd1de4a76e3cf75 (patch) | |
tree | 4c5357a3d3482b14cbc3773374aa885e1e29e90c /std/node | |
parent | f7ab19b1b7ba929f7fd1550e2e4ecebe91cd9ea3 (diff) |
BREAKING: Use LLVM target triple for Deno.build (#4948)
Deno.build.os values have changed to correspond to standard LLVM target triples
"win" -> "windows"
"mac" -> "darwin"
Diffstat (limited to 'std/node')
-rw-r--r-- | std/node/_fs/_fs_chmod_test.ts | 4 | ||||
-rw-r--r-- | std/node/_fs/_fs_chown_test.ts | 5 | ||||
-rw-r--r-- | std/node/_fs/_fs_readlink_test.ts | 10 | ||||
-rw-r--r-- | std/node/os.ts | 4 | ||||
-rw-r--r-- | std/node/process.ts | 5 |
5 files changed, 13 insertions, 15 deletions
diff --git a/std/node/_fs/_fs_chmod_test.ts b/std/node/_fs/_fs_chmod_test.ts index a3d814b51..e43f09788 100644 --- a/std/node/_fs/_fs_chmod_test.ts +++ b/std/node/_fs/_fs_chmod_test.ts @@ -5,7 +5,7 @@ import { chmod, chmodSync } from "./_fs_chmod.ts"; test({ name: "ASYNC: Permissions are changed (non-Windows)", - ignore: Deno.build.os === "win", + ignore: Deno.build.os === "windows", async fn() { const tempFile: string = await Deno.makeTempFile(); const originalFileMode: number | null = (await Deno.lstat(tempFile)).mode; @@ -31,7 +31,7 @@ test({ test({ name: "SYNC: Permissions are changed (non-Windows)", - ignore: Deno.build.os === "win", + ignore: Deno.build.os === "windows", fn() { const tempFile: string = Deno.makeTempFileSync(); const originalFileMode: number | null = Deno.lstatSync(tempFile).mode; diff --git a/std/node/_fs/_fs_chown_test.ts b/std/node/_fs/_fs_chown_test.ts index fd31a8c62..1c1393ac4 100644 --- a/std/node/_fs/_fs_chown_test.ts +++ b/std/node/_fs/_fs_chown_test.ts @@ -3,8 +3,9 @@ const { test } = Deno; import { fail, assertEquals } from "../../testing/asserts.ts"; import { chown, chownSync } from "./_fs_chown.ts"; -//chown is difficult to test. Best we can do is set the existing user id/group id again -const ignore = Deno.build.os == "win"; +// chown is difficult to test. Best we can do is set the existing user id/group +// id again +const ignore = Deno.build.os == "windows"; test({ ignore, diff --git a/std/node/_fs/_fs_readlink_test.ts b/std/node/_fs/_fs_readlink_test.ts index 151d3f782..4b2165f8a 100644 --- a/std/node/_fs/_fs_readlink_test.ts +++ b/std/node/_fs/_fs_readlink_test.ts @@ -6,13 +6,13 @@ const testDir = Deno.makeTempDirSync(); const oldname = testDir + "/oldname"; const newname = testDir + "/newname"; -if (Deno.build.os !== "win") { +if (Deno.build.os !== "windows") { Deno.symlinkSync(oldname, newname); } test({ name: "readlinkSuccess", - ignore: Deno.build.os === "win", + ignore: Deno.build.os === "windows", async fn() { const data = await new Promise((res, rej) => { readlink(newname, (err, data) => { @@ -30,7 +30,7 @@ test({ test({ name: "readlinkEncodeBufferSuccess", - ignore: Deno.build.os === "win", + ignore: Deno.build.os === "windows", async fn() { const data = await new Promise((res, rej) => { readlink(newname, { encoding: "buffer" }, (err, data) => { @@ -48,7 +48,7 @@ test({ test({ name: "readlinkSyncSuccess", - ignore: Deno.build.os === "win", + ignore: Deno.build.os === "windows", fn() { const data = readlinkSync(newname); assertEquals(typeof data, "string"); @@ -58,7 +58,7 @@ test({ test({ name: "readlinkEncodeBufferSuccess", - ignore: Deno.build.os === "win", + ignore: Deno.build.os === "windows", fn() { const data = readlinkSync(newname, { encoding: "buffer" }); assert(data instanceof Uint8Array); diff --git a/std/node/os.ts b/std/node/os.ts index 7c61e910b..27b054f4d 100644 --- a/std/node/os.ts +++ b/std/node/os.ts @@ -146,7 +146,7 @@ export function hostname(): string { /** Returns an array containing the 1, 5, and 15 minute load averages */ export function loadavg(): number[] { - if (Deno.build.os == "win") { + if (Deno.build.os === "windows") { return [0, 0, 0]; } return Deno.loadavg(); @@ -222,4 +222,4 @@ export const constants = { }, }; -export const EOL = Deno.build.os == "win" ? fsEOL.CRLF : fsEOL.LF; +export const EOL = Deno.build.os == "windows" ? fsEOL.CRLF : fsEOL.LF; diff --git a/std/node/process.ts b/std/node/process.ts index 89d383e8e..310a7e814 100644 --- a/std/node/process.ts +++ b/std/node/process.ts @@ -7,10 +7,7 @@ const versions = { ...Deno.version, }; -const osToPlatform = (os: Deno.OperatingSystem): string => - os === "win" ? "win32" : os === "mac" ? "darwin" : os; - -const platform = osToPlatform(Deno.build.os); +const platform = Deno.build.os === "windows" ? "win32" : Deno.build.os; const { arch } = Deno.build; |