Skip to content

Commit

Permalink
fix: cmd/write-nfo - make sure path is absolute
Browse files Browse the repository at this point in the history
This work around some weird edge case I hit occasionally.
  • Loading branch information
sjorge committed Dec 6, 2024
1 parent 0811eef commit b164c45
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/cmd/write-nfo.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { OptionValues } from "@commander-js/extra-typings";
import {
Command,
Argument,
Option,
InvalidArgumentError,
} from "@commander-js/extra-typings";
Expand Down Expand Up @@ -189,7 +190,14 @@ export function addNfoCommand(program: Command): void {
program
.command("write-nfo")
.description("write NFO files")
.argument("<path>", "path to anime show directory")
.addArgument(
new Argument("<path>", "path to anime show directory").argParser(
(value: string) => {
if (!path.isAbsolute(value)) return path.resolve(value);
return value;
},
),
)
.addOption(
new Option(
"--aid <id>",
Expand Down

0 comments on commit b164c45

Please sign in to comment.