Skip to content

Commit

Permalink
fix: use fallback dirname for node:18
Browse files Browse the repository at this point in the history
  • Loading branch information
t0bst4r committed Oct 27, 2024
1 parent 494d994 commit bbe0903
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/backend/src/cli.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
#!/usr/bin/env node

import * as url from "node:url";

const argv = [...process.argv];
process.argv.splice(0, process.argv.length);

import yargs from "yargs";
import { hideBin } from "yargs/helpers";
import * as path from "node:path";

const dirname =
import.meta.dirname ?? url.fileURLToPath(new URL(".", import.meta.url));

export async function cli(argv: string[]): Promise<void> {
const start = await import("./commands/start.js").then((m) => m.default);
const webDist =
process.env.NODE_ENV === "development"
? undefined
: path.join(import.meta.dirname, "../frontend");
: path.join(dirname, "../frontend");
yargs(hideBin(argv))
.env("HAMH_")
.scriptName("home-assistant-matter-hub")
Expand Down

0 comments on commit bbe0903

Please sign in to comment.