From 0a81ec6b1e00ef01900393ae0460eaf3a6ec05d6 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Sat, 20 Jun 2020 23:49:27 -0400 Subject: Remove Deno.dir and dirs dependency (#6385) --- cli/js/ops/os.ts | 30 ------------------------------ 1 file changed, 30 deletions(-) (limited to 'cli/js/ops') diff --git a/cli/js/ops/os.ts b/cli/js/ops/os.ts index e63d8b358..696c9f10b 100644 --- a/cli/js/ops/os.ts +++ b/cli/js/ops/os.ts @@ -1,6 +1,5 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. import { sendSync } from "./dispatch_json.ts"; -import { errors } from "../errors.ts"; export function loadavg(): number[] { return sendSync("op_loadavg"); @@ -40,35 +39,6 @@ export const env = { delete: deleteEnv, }; -type DirKind = - | "home" - | "cache" - | "config" - | "executable" - | "data" - | "data_local" - | "audio" - | "desktop" - | "document" - | "download" - | "font" - | "picture" - | "public" - | "template" - | "tmp" - | "video"; - -export function dir(kind: DirKind): string | null { - try { - return sendSync("op_get_dir", { kind }); - } catch (error) { - if (error instanceof errors.PermissionDenied) { - throw error; - } - return null; - } -} - export function execPath(): string { return sendSync("op_exec_path"); } -- cgit v1.2.3