summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--os/README.md16
-rw-r--r--os/mod.ts26
-rw-r--r--os/test.ts8
-rwxr-xr-xtest.ts1
4 files changed, 0 insertions, 51 deletions
diff --git a/os/README.md b/os/README.md
deleted file mode 100644
index 0f2ea810b..000000000
--- a/os/README.md
+++ /dev/null
@@ -1,16 +0,0 @@
-# os
-
-Module provide platform-independent interface to operating system functionality.
-
-## Usage
-
-### userHomeDir
-
-Returns the current user's home directory. On Unix, including macOS, it returns the \$HOME environment variable. On Windows, it returns %USERPROFILE%.
-Needs permissions to access env (--allow-env).
-
-```ts
-import { userHomeDir } from "https://deno.land/std/os/mod.ts";
-
-userHomeDir();
-```
diff --git a/os/mod.ts b/os/mod.ts
deleted file mode 100644
index a2bb0457b..000000000
--- a/os/mod.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
-
-/**
- * Returns the current user's home directory.
- * On Unix, including macOS, it returns the $HOME environment variable.
- * On Windows, it returns %USERPROFILE%.
- * Needs permissions to access env (--allow-env).
- *
- * Ported from Go: https://github.com/golang/go/blob/go1.12.5/src/os/file.go#L389
- */
-export function userHomeDir(): string {
- let env = "HOME";
- let envErr = "$HOME";
-
- if (Deno.platform.os === "win") {
- env = "USERPROFILE";
- envErr = "%USERPROFILE%";
- }
-
- const value = Deno.env()[env];
- if (value !== "") {
- return value;
- }
-
- throw new Error(`Environment variable '${envErr}' is not defined.`);
-}
diff --git a/os/test.ts b/os/test.ts
deleted file mode 100644
index f1993f22b..000000000
--- a/os/test.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
-import { test } from "../testing/mod.ts";
-import { assertNotEquals } from "../testing/asserts.ts";
-import { userHomeDir } from "./mod.ts";
-
-test(function testUserHomeDir(): void {
- assertNotEquals(userHomeDir(), "");
-});
diff --git a/test.ts b/test.ts
index 07e57e35b..b3497da27 100755
--- a/test.ts
+++ b/test.ts
@@ -24,7 +24,6 @@ import "./util/test.ts";
import "./uuid/test.ts";
import "./ws/test.ts";
import "./encoding/test.ts";
-import "./os/test.ts";
import { xrun } from "./prettier/util.ts";
import { red, green } from "./colors/mod.ts";