Skip to content

Commit

Permalink
chore: import node:process to fix issue on Deno
Browse files Browse the repository at this point in the history
  • Loading branch information
kravetsone committed May 13, 2024
1 parent b10a3d9 commit 9686e30
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gramio/autoload",
"version": "0.0.3",
"version": "0.0.4",
"description": "Autoload commands plugin for GramIO",
"main": "dist/index.js",
"type": "commonjs",
Expand Down
6 changes: 1 addition & 5 deletions src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import { isAbsolute, join } from "node:path";
import process from "node:process";

export function getPath(dir: string) {
// @ts-ignore Deno moment
if (typeof process === "undefined") return dir;

if (isAbsolute(dir)) return dir;
// @ts-ignore Deno moment
if (isAbsolute(process.argv[1])) return join(process.argv[1], "..", dir);

// @ts-ignore Deno moment
return join(process.cwd(), process.argv[1], "..", dir);
}

0 comments on commit 9686e30

Please sign in to comment.