Skip to content

Commit

Permalink
fix relative file paths
Browse files Browse the repository at this point in the history
  • Loading branch information
bmesuere committed Aug 7, 2024
1 parent e66da23 commit 2472da2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
6 changes: 5 additions & 1 deletion lib/commands/base_command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ export abstract class BaseCommand {
version: string;

constructor(options?: { exitOverride?: boolean, suppressOutput?: boolean }) {
this.version = JSON.parse(readFileSync(new URL("../../package.json", import.meta.url), "utf8")).version;
let p = "";
if (import.meta.url.includes("/dist/")) {
p = "../";
}
this.version = JSON.parse(readFileSync(new URL(p + "../../package.json", import.meta.url), "utf8")).version;
this.program = this.create(options);
}

Expand Down
6 changes: 5 additions & 1 deletion lib/commands/unipept/unipept_subcommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ export abstract class UnipeptSubcommand {

constructor(name: string) {
this.name = name;
const version = JSON.parse(readFileSync(new URL("../../../package.json", import.meta.url), "utf8")).version;
let p = "";
if (import.meta.url.includes("/dist/")) {
p = "../";
}
const version = JSON.parse(readFileSync(new URL(p + "../../../package.json", import.meta.url), "utf8")).version;
this.user_agent = `unipept-cli/${version}`;
this.command = this.create(name);
this.fasta = false;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "unipept-cli",
"version": "4.0.0-1",
"version": "4.0.0-2",
"description": "Command line interface to the Unipept web services",
"repository": "[email protected]:unipept/unipept-cli.git",
"author": "Bart Mesuere <[email protected]>",
Expand Down

0 comments on commit 2472da2

Please sign in to comment.