Skip to content

Commit db52fac

Browse files
authored
fix: remove version output (#3143)
There isn't an easy way to have this version without targeting esm which is a can of worms.
1 parent a2698fd commit db52fac

2 files changed

Lines changed: 3 additions & 8 deletions

File tree

packages/list/lib/index.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22

33
import { autoDetect, PortInfo } from '@serialport/bindings-cpp'
44
import { program, Option } from 'commander'
5-
import pkg from '../package.json' assert { type: 'json' };
6-
7-
const { version } = pkg;
85

96
const formatOption = new Option('-f, --format <type>', 'Format the output').choices(['text', 'json', 'jsonline', 'jsonl']).default('text')
107

11-
program.version(version).description('List available serial ports').addOption(formatOption).parse(process.argv)
8+
program
9+
.description('List available serial ports')
10+
.addOption(formatOption).parse(process.argv)
1211

1312
function jsonl(ports: PortInfo[]) {
1413
ports.forEach(port => {

packages/terminal/lib/index.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,11 @@ import { program } from 'commander'
55
import { SerialPortStream, OpenOptions } from '@serialport/stream'
66
import { OutputTranslator } from './output-translator'
77
import { autoDetect, AutoDetectTypes } from '@serialport/bindings-cpp'
8-
import pkg from '../package.json' assert { type: 'json' };
9-
10-
const { version } = pkg;
118
const binding = autoDetect()
129

1310
const makeNumber = (input: string) => Number(input)
1411

1512
program
16-
.version(version)
1713
.usage('--list OR -p <port> -b <baud rate> [options...]')
1814
.description('A basic terminal interface for communicating over a serial port. Pressing ctrl+c exits.')
1915
.option('-l --list', 'List available ports then exit')

0 commit comments

Comments
 (0)