We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0889ed8 commit 6880074Copy full SHA for 6880074
src/bin.ts
@@ -22,6 +22,17 @@ import {
22
import type { PkgManagerName } from "./pkg_manager.ts";
23
24
const args = process.argv.slice(2);
25
+let __dirname: string;
26
+
27
+// @ts-ignore
28
+if (import.meta.url) {
29
+ // @ts-ignore
30
+ __dirname = path.dirname(new URL(import.meta.url).pathname);
31
+} else {
32
+ // For Node.js environments that do not support import.meta.url
33
+ // which means commonjs environments.
34
+ __dirname = globalThis.__dirname;
35
+}
36
37
function prettyPrintRow(rows: [string, string][]) {
38
let max = 0;
0 commit comments