@swipt/cli 0.1.0-nightly.47 → 0.1.0-nightly.49
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/coredevice.mjs +103 -40
- package/output.mjs +61 -0
- package/package.json +6 -4
- package/sideload/trust.js +188 -174
- package/sideload.mjs +597 -183
- package/swipt.mjs +20 -10
package/swipt.mjs
CHANGED
|
@@ -49,6 +49,18 @@ const nightlyOption = {
|
|
|
49
49
|
nightly: { type: "boolean", help: "use nightly build" },
|
|
50
50
|
};
|
|
51
51
|
|
|
52
|
+
const setupOptions = {
|
|
53
|
+
"no-setup": {
|
|
54
|
+
type: "boolean",
|
|
55
|
+
help: "do not pair Swipt, trust its developer or publish its API",
|
|
56
|
+
},
|
|
57
|
+
"no-setup-pair": { type: "boolean", help: "do not pair Swipt" },
|
|
58
|
+
"no-setup-api": {
|
|
59
|
+
type: "boolean",
|
|
60
|
+
help: "do not publish the API to the local network",
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
|
|
52
64
|
const durationUnits = {
|
|
53
65
|
ns: 1e-6,
|
|
54
66
|
us: 1e-3,
|
|
@@ -394,23 +406,21 @@ const commands = [
|
|
|
394
406
|
options: {
|
|
395
407
|
...passcodeOptions("set up auto-unlock with this passcode"),
|
|
396
408
|
...nightlyOption,
|
|
409
|
+
...setupOptions,
|
|
397
410
|
},
|
|
398
411
|
run: sideload.install,
|
|
399
412
|
},
|
|
400
413
|
{
|
|
401
414
|
name: "update",
|
|
402
|
-
short: "
|
|
415
|
+
short: "Renew signing if needed and update to latest release",
|
|
403
416
|
args: [0, 0],
|
|
404
|
-
options:
|
|
417
|
+
options: {
|
|
418
|
+
...passcodeOptions("unlock device with this passcode"),
|
|
419
|
+
...nightlyOption,
|
|
420
|
+
...setupOptions,
|
|
421
|
+
},
|
|
405
422
|
run: sideload.update,
|
|
406
423
|
},
|
|
407
|
-
{
|
|
408
|
-
name: "start",
|
|
409
|
-
short: "Trust developer if needed and open Swipt",
|
|
410
|
-
args: [0, 0],
|
|
411
|
-
options: passcodeOptions("unlock device with this passcode"),
|
|
412
|
-
run: sideload.start,
|
|
413
|
-
},
|
|
414
424
|
{
|
|
415
425
|
name: "uninstall",
|
|
416
426
|
short: "Remove Swipt",
|
|
@@ -631,7 +641,7 @@ async function main() {
|
|
|
631
641
|
} catch (error) {
|
|
632
642
|
if (error instanceof FalseResult) {
|
|
633
643
|
process.exitCode = 1;
|
|
634
|
-
} else if (interrupt.signal.aborted) {
|
|
644
|
+
} else if (interrupt.signal.aborted || error.name === "ExitPromptError") {
|
|
635
645
|
process.exitCode = 130;
|
|
636
646
|
} else {
|
|
637
647
|
process.exitCode = printError(error, target);
|