diff options
author | Yoshiya Hinosawa <stibium121@gmail.com> | 2019-09-10 02:58:36 +0900 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2019-09-09 13:58:36 -0400 |
commit | 7b22dec0fa6c83e0bd8f6ebee38c05001b61e408 (patch) | |
tree | 52e684e01eb91c755dfdb7c8bcf1b9cbf9e6b6af | |
parent | d7f3e28eed8c75e51b90647741ec882ff8cdf814 (diff) |
fix: replace Deno.platform usages (denoland/deno_std#590)
Original: https://github.com/denoland/deno_std/commit/0e6f163ac6a5a03f45a90960a6f1193ee2718fe3
-rw-r--r-- | fs/copy_test.ts | 2 | ||||
-rw-r--r-- | fs/ensure_symlink_test.ts | 2 | ||||
-rw-r--r-- | http/file_server_test.ts | 4 | ||||
-rw-r--r-- | installer/mod.ts | 2 | ||||
-rw-r--r-- | installer/test.ts | 2 |
5 files changed, 6 insertions, 6 deletions
diff --git a/fs/copy_test.ts b/fs/copy_test.ts index 09aae0ff6..a11838c4b 100644 --- a/fs/copy_test.ts +++ b/fs/copy_test.ts @@ -16,7 +16,7 @@ import { ensureSymlink, ensureSymlinkSync } from "./ensure_symlink.ts"; const testdataDir = path.resolve("fs", "testdata"); // TODO(axetroy): Add test for Windows once symlink is implemented for Windows. -const isWindows = Deno.platform.os === "win"; +const isWindows = Deno.build.os === "win"; async function testCopy( name: string, diff --git a/fs/ensure_symlink_test.ts b/fs/ensure_symlink_test.ts index d769615fb..4dee56788 100644 --- a/fs/ensure_symlink_test.ts +++ b/fs/ensure_symlink_test.ts @@ -10,7 +10,7 @@ import { ensureSymlink, ensureSymlinkSync } from "./ensure_symlink.ts"; import * as path from "./path/mod.ts"; const testdataDir = path.resolve("fs", "testdata"); -const isWindows = Deno.platform.os === "win"; +const isWindows = Deno.build.os === "win"; test(async function ensureSymlinkIfItNotExist(): Promise<void> { const testDir = path.join(testdataDir, "link_file_1"); diff --git a/http/file_server_test.ts b/http/file_server_test.ts index 6623406d0..b7148905b 100644 --- a/http/file_server_test.ts +++ b/http/file_server_test.ts @@ -61,9 +61,9 @@ test(async function serveDirectory(): Promise<void> { // `Deno.FileInfo` is not completely compatible with Windows yet // TODO: `mode` should work correctly in the future. // Correct this test case accordingly. - Deno.platform.os !== "win" && + Deno.build.os !== "win" && assert(/<td class="mode">\([a-zA-Z-]{10}\)<\/td>/.test(page)); - Deno.platform.os === "win" && + Deno.build.os === "win" && assert(/<td class="mode">\(unknown mode\)<\/td>/.test(page)); assert( page.includes( diff --git a/installer/mod.ts b/installer/mod.ts index d6ebedbd4..1b9217cd4 100644 --- a/installer/mod.ts +++ b/installer/mod.ts @@ -10,7 +10,7 @@ const encoder = new TextEncoder(); const decoder = new TextDecoder("utf-8"); // Regular expression to test disk driver letter. eg "C:\\User\username\path\to" const driverLetterReg = /^[c-z]:/i; -const isWindows = Deno.platform.os === "win"; +const isWindows = Deno.build.os === "win"; function showHelp(): void { console.log(`deno installer diff --git a/installer/test.ts b/installer/test.ts index 2fd36e91e..bfe9bf652 100644 --- a/installer/test.ts +++ b/installer/test.ts @@ -10,7 +10,7 @@ import * as fs from "../fs/mod.ts"; import { install, isRemoteUrl } from "./mod.ts"; let fileServer: Deno.Process; -const isWindows = Deno.platform.os === "win"; +const isWindows = Deno.build.os === "win"; // copied from `http/file_server_test.ts` async function startFileServer(): Promise<void> { |