Skip to content

Commit

Permalink
Merge pull request #3 from Hexagon/main
Browse files Browse the repository at this point in the history
Various fixes
  • Loading branch information
Pinta365 authored Mar 9, 2024
2 parents b745af9 + a88e780 commit c563379
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
.env
.env-local
.vscode
test.ts
test.ts
package.json
package-lock.json
deno.lock
node_modules
2 changes: 1 addition & 1 deletion deno.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"exports": "./mod.ts",

"tasks": {
"test": "deno test --allow-env --allow-read ./tests/deno.ts",
"test": "cd tests && deno test --allow-env --allow-read",
"publish": "deno publish --config jsr.jsonc",
"publish-dry": "deno publish --dry-run --config jsr.jsonc"
},
Expand Down
8 changes: 2 additions & 6 deletions lib/filehandler.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { EnvOptions, FileReadError, UnsupportedEnvironmentError } from "./helpers.ts";
import { readFile } from "node:fs/promises";

//Simulates/shims the Deno runtime for development purposes.
declare const Deno: {
Expand Down Expand Up @@ -35,14 +36,9 @@ export async function loadEnvFile(
try {
switch (currentRuntime) {
case "deno":
fileContent = Deno.readTextFileSync(filePath);
break;
case "bun":
fileContent = await Bun.file(filePath).text();
break;
case "node": {
const fs = await import("node:fs");
fileContent = fs.readFileSync(filePath, "utf-8");
fileContent = await readFile(filePath, "utf-8");
break;
}
default:
Expand Down
File renamed without changes.

0 comments on commit c563379

Please sign in to comment.