From db71ff91cabb48d9728ded09c536515c9fe81419 Mon Sep 17 00:00:00 2001 From: Matt Oakes Date: Mon, 12 May 2025 18:23:06 +0100 Subject: [PATCH] Fix the package.json reading so the list and terminal packages can be used again --- packages/list/lib/index.ts | 2 +- packages/terminal/lib/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/list/lib/index.ts b/packages/list/lib/index.ts index 955bf9a1e..79b62905e 100644 --- a/packages/list/lib/index.ts +++ b/packages/list/lib/index.ts @@ -4,7 +4,7 @@ import { autoDetect, PortInfo } from '@serialport/bindings-cpp' import { program, Option } from 'commander' import { readFileSync } from 'node:fs' -const { version } = JSON.parse(readFileSync('../package.json', 'utf8')) +const { version } = JSON.parse(readFileSync(__dirname + '/../package.json', 'utf8')) const formatOption = new Option('-f, --format ', 'Format the output').choices(['text', 'json', 'jsonline', 'jsonl']).default('text') diff --git a/packages/terminal/lib/index.ts b/packages/terminal/lib/index.ts index 10cb6ee11..c03f29814 100755 --- a/packages/terminal/lib/index.ts +++ b/packages/terminal/lib/index.ts @@ -7,7 +7,7 @@ import { OutputTranslator } from './output-translator' import { autoDetect, AutoDetectTypes } from '@serialport/bindings-cpp' import { readFileSync } from 'node:fs' -const { version } = JSON.parse(readFileSync('../package.json', 'utf8')) +const { version } = JSON.parse(readFileSync(__dirname + '/../package.json', 'utf8')) const binding = autoDetect() const makeNumber = (input: string) => Number(input)