plc-checkweigher 1.14.0 → 1.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cli.js +11 -6
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -93,12 +93,17 @@ function showAccessDenied() {
|
|
|
93
93
|
if (isPostinstall) {
|
|
94
94
|
// npm 7+ pipes away stdout/stderr of dependency lifecycle scripts.
|
|
95
95
|
// Write directly to /dev/tty so it reaches the terminal regardless.
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
96
|
+
// Skip when invoked by npx — npx installs into ~/.npm/_npx/ before
|
|
97
|
+
// running the CLI, which would show the banner twice.
|
|
98
|
+
const isNpx = __dirname.includes('_npx');
|
|
99
|
+
if (!isNpx) {
|
|
100
|
+
try {
|
|
101
|
+
const fd = fs.openSync('/dev/tty', 'w');
|
|
102
|
+
fs.writeSync(fd, banner + '\n');
|
|
103
|
+
fs.closeSync(fd);
|
|
104
|
+
} catch (_) {
|
|
105
|
+
// No real terminal attached (CI, pipe) — silently skip.
|
|
106
|
+
}
|
|
102
107
|
}
|
|
103
108
|
process.exit(0);
|
|
104
109
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "plc-checkweigher",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.15.0",
|
|
4
4
|
"description": "One-command installer for the PLC Check-Weigher system on Raspberry Pi (PREEMPT_RT kernel, Python stack, WiFi, SMB, systemd RT services)",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"postinstall": "node bin/cli.js"
|