Skip to content

Commit

Permalink
[patch] fix cli file name
Browse files Browse the repository at this point in the history
  • Loading branch information
electrovir committed Aug 19, 2024
1 parent 98b9468 commit e64891c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
3 changes: 2 additions & 1 deletion src/cli/cli.ts
Original file line number Diff line number Diff line change
@@ -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);
});
4 changes: 2 additions & 2 deletions src/cli/run-cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string>): CliInput {
export function extractArgs(rawArgs: ReadonlyArray<string>, 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));
Expand Down

0 comments on commit e64891c

Please sign in to comment.