From f55a40ac8d5edba4daf0d61794eb86d37064a517 Mon Sep 17 00:00:00 2001 From: hsb-tonmoy Date: Sun, 22 Jun 2025 21:02:28 -0500 Subject: [PATCH] fix: using fileURLToPath to properly resolve windows file path --- src/index.ts | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/index.ts b/src/index.ts index d28420d..11007a7 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,14 +1,21 @@ #!/usr/bin/env node // Suppress punycode deprecation warning from transitive dependencies -process.removeAllListeners('warning'); -process.on('warning', (warning) => { - if (warning.name === 'DeprecationWarning' && warning.message.includes('punycode')) { +process.removeAllListeners("warning"); +process.on("warning", (warning) => { + if ( + warning.name === "DeprecationWarning" && + warning.message.includes("punycode") + ) { return; // Suppress punycode warnings } console.warn(warning.stack); }); -import {execute} from '@oclif/core' +import { execute } from "@oclif/core"; +import { dirname } from "node:path"; +import { fileURLToPath } from "node:url"; -await execute({dir: import.meta.url}) \ No newline at end of file +const __dirname = dirname(fileURLToPath(import.meta.url)); + +await execute({ dir: __dirname });