diff --git a/package-lock.json b/package-lock.json index 3ae3011..a7d5cb8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "git-vir", - "version": "2.0.0", + "version": "2.0.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "git-vir", - "version": "2.0.0", + "version": "2.0.1", "license": "(MIT or CC0 1.0)", "dependencies": { "@augment-vir/common": "^29.3.0", diff --git a/package.json b/package.json index 2149ff9..801d047 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "git-vir", - "version": "2.0.0", + "version": "2.0.1", "description": "CLI tool for making life with git and GitHub easier.", "keywords": [], "homepage": "https://github.com/electrovir/git-vir", diff --git a/src/cli/cli.ts b/src/cli/cli.ts index ce338b5..ea25947 100644 --- a/src/cli/cli.ts +++ b/src/cli/cli.ts @@ -1,7 +1,8 @@ #!/usr/bin/env -S npx tsx +import {fileURLToPath} from 'node:url'; import {extractArgs, runCli} from './run-cli.js'; -runCli(extractArgs(process.argv)).catch(() => { +runCli(extractArgs(process.argv, fileURLToPath(import.meta.url))).catch(() => { process.exit(1); }); diff --git a/src/cli/run-cli.ts b/src/cli/run-cli.ts index 664cdcd..2bf4bf5 100644 --- a/src/cli/run-cli.ts +++ b/src/cli/run-cli.ts @@ -42,11 +42,11 @@ export async function runCli({command, cwd, remoteName, otherArgs}: CliInput) { } /** Extracts arguments from a raw string of CLI args. */ -export function extractArgs(rawArgs: ReadonlyArray): CliInput { +export function extractArgs(rawArgs: ReadonlyArray, cliFilePath: string): CliInput { const relevantArgs = extractRelevantArgs({ rawArgs, binName: 'git-vir', - fileName: import.meta.filename, + fileName: cliFilePath, }).reverse(); const commandIndex = relevantArgs.findIndex((arg) => isEnumValue(arg, GitVirCommandName));