Skip to content
This repository was archived by the owner on May 24, 2023. It is now read-only.

Commit b68c2fc

Browse files
author
Jakob Rosenberg
authored
Merge pull request #305 from pycom/fix-serialport-through-plugin
Fix-serialport-through-plugin
2 parents 9ee897e + 69a1f54 commit b68c2fc

File tree

4 files changed

+833
-878
lines changed

4 files changed

+833
-878
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## [2.3.4](https://github.com/pycom/pymakr-atom/compare/v2.3.3...v2.3.4) (2022-04-06)
2+
3+
4+
### Bug Fixes
5+
6+
* use postinstall to install bindings with npm ([ff6635d](https://github.com/pycom/pymakr-atom/commit/ff6635dd0618134903d11bb9294a6f733f383c64))
7+
18
## [2.3.3](https://github.com/pycom/pymakr-atom/compare/v2.3.2...v2.3.3) (2022-04-05)
29

310

lib/main.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@ export default {
99
config: Config.settings(),
1010

1111
activate(state) {
12+
try {
13+
require('serialport');
14+
} catch (err) {
15+
if (err.code === 'MODULE_NOT_FOUND') {
16+
console.log('serialport not installed. Installing...');
17+
require('child_process').execSync('npm install serialport');
18+
console.log('Installed serialport!');
19+
}
20+
}
1221

1322
const _this = this;
1423
this.prepareSerialPort(error => {

0 commit comments

Comments
 (0)