plc-checkweigher 1.11.0 → 1.12.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 +4 -19
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -87,10 +87,6 @@ function showAccessDenied() {
|
|
|
87
87
|
console.log('');
|
|
88
88
|
console.log(` ${R}⚠ Please contact administrator for access${NC}`);
|
|
89
89
|
console.log('');
|
|
90
|
-
console.log(` ${D}Install:${NC} npx plc-checkweigher ${Y}-tov${NC}`);
|
|
91
|
-
console.log(` ${D}Uninstall:${NC} npx plc-checkweigher ${Y}-ex${NC}`);
|
|
92
|
-
console.log(` ${D}Help:${NC} npx plc-checkweigher ${Y}--help${NC}`);
|
|
93
|
-
console.log('');
|
|
94
90
|
|
|
95
91
|
process.exit(1);
|
|
96
92
|
}
|
|
@@ -103,24 +99,13 @@ const UNINSTALL_FLAGS = ['-ex', '--uninstall', 'uninstall', 'remove'];
|
|
|
103
99
|
const HELP_FLAGS = ['-h', '--help', 'help'];
|
|
104
100
|
|
|
105
101
|
if (HELP_FLAGS.includes(arg)) {
|
|
106
|
-
|
|
107
|
-
${B}npx plc-checkweigher${NC} — PLC Check-Weigher setup utility
|
|
108
|
-
|
|
109
|
-
${Y}npx plc-checkweigher -tov${NC} Install ${D}(set up stack, services, RT kernel)${NC}
|
|
110
|
-
${Y}npx plc-checkweigher -ex${NC} Uninstall ${D}(remove everything)${NC}
|
|
111
|
-
${Y}npx plc-checkweigher --help${NC} Help
|
|
112
|
-
|
|
113
|
-
${D}Aliases:${NC}
|
|
114
|
-
${D}-tov / --install / install${NC}
|
|
115
|
-
${D}-ex / --uninstall / uninstall / remove${NC}
|
|
116
|
-
`);
|
|
117
|
-
process.exit(0);
|
|
102
|
+
showAccessDenied();
|
|
118
103
|
}
|
|
119
104
|
|
|
120
105
|
let mode = 'access'; // default: show brand banner + access denied
|
|
121
106
|
if (INSTALL_FLAGS.includes(arg)) mode = 'install';
|
|
122
107
|
else if (UNINSTALL_FLAGS.includes(arg)) mode = 'uninstall';
|
|
123
|
-
else if (arg !== '')
|
|
108
|
+
else if (arg !== '') showAccessDenied();
|
|
124
109
|
|
|
125
110
|
// ── Platform guards (skip for help / access-denied) ───────────────────────────
|
|
126
111
|
if (mode !== 'access') {
|
|
@@ -143,7 +128,7 @@ if (mode === 'access') {
|
|
|
143
128
|
|
|
144
129
|
if (mode === 'install') {
|
|
145
130
|
if (!fs.existsSync(setupScript))
|
|
146
|
-
die('setup.sh not found — try: npx plc-checkweigher@latest
|
|
131
|
+
die('setup.sh not found — try reinstalling the package: npx plc-checkweigher@latest');
|
|
147
132
|
|
|
148
133
|
console.log(`
|
|
149
134
|
${B}╔══════════════════════════════════════════════╗
|
|
@@ -171,7 +156,7 @@ ${B}╔════════════════════════
|
|
|
171
156
|
|
|
172
157
|
if (mode === 'uninstall') {
|
|
173
158
|
if (!fs.existsSync(uninstallScript))
|
|
174
|
-
die('uninstall.sh not found — try: npx plc-checkweigher@latest
|
|
159
|
+
die('uninstall.sh not found — try reinstalling the package: npx plc-checkweigher@latest');
|
|
175
160
|
|
|
176
161
|
console.log(`
|
|
177
162
|
${R}╔══════════════════════════════════════════════╗
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "plc-checkweigher",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.12.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
|
"bin": {
|
|
6
6
|
"plc-checkweigher": "bin/cli.js"
|