fix: find arduino

This commit is contained in:
Francis Gulotta 2022-01-22 22:25:20 -05:00
parent 191409a682
commit 34ccc2edee
No known key found for this signature in database
GPG key ID: 69707324B0567369
2 changed files with 7 additions and 6 deletions

View file

@ -1,9 +1,10 @@
#!/usr/bin/env node
#!/usr/bin/env node -r esbuild-register
// outputs the path to an Arduino to stdout or an error to stderror
const SerialPort = require('../packages/serialport')
SerialPort.list().then(ports => {
import { autoDetect } from '../lib'
autoDetect().list().then(ports => {
const port = ports.find(port => /arduino/i.test(port.manufacturer))
if (!port) {
console.error('Arduino Not found')

View file

@ -61,10 +61,10 @@
"prebuildify-cross": "prebuildify-cross --napi --target 14.0.0 --force --strip --verbose",
"rebuild": "node-gyp rebuild",
"coverage": "nyc report --reporter=text-lcov > coverage.lcov && codecov",
"format": "eslint lib test --fix",
"lint": "eslint lib test && cc --verbose",
"format": "eslint lib test bin --fix",
"lint": "eslint lib test bin && cc --verbose",
"test": "nyc --reporter=html --reporter=text --reporter lcovonly mocha",
"test:arduino": "TEST_PORT=$(./bin/find-arduino.js) npm test",
"test:arduino": "TEST_PORT=$(./bin/find-arduino.ts) npm test",
"test:watch": "mocha -w",
"semantic-release": "semantic-release",
"typecheck": "tsc"