@prozilla-os/core 2.0.2 → 2.1.2
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/README.md +105 -113
- package/dist/chunks/afire-DlRwSfiJ.js +68 -0
- package/dist/chunks/afire-DlRwSfiJ.js.map +1 -0
- package/dist/chunks/banner-jSvYkuqB.js +351 -0
- package/dist/chunks/banner-jSvYkuqB.js.map +1 -0
- package/dist/chunks/cat-B_KOgu80.js +37 -0
- package/dist/chunks/cat-B_KOgu80.js.map +1 -0
- package/dist/chunks/clear-C8xhqHmC.js +12 -0
- package/dist/chunks/clear-C8xhqHmC.js.map +1 -0
- package/dist/chunks/compgen-2kLzA1wV.js +11 -0
- package/dist/chunks/compgen-2kLzA1wV.js.map +1 -0
- package/dist/chunks/{cowsay-hTKzWScw.js → cowsay-CTLxUPtF.js} +13 -13
- package/dist/chunks/cowsay-CTLxUPtF.js.map +1 -0
- package/dist/chunks/date-CA1ub92R.js +33 -0
- package/dist/chunks/date-CA1ub92R.js.map +1 -0
- package/dist/chunks/dir-w2XNd6oI.js +11 -0
- package/dist/chunks/dir-w2XNd6oI.js.map +1 -0
- package/dist/chunks/doubleBracket-B5nqIccY.js +78 -0
- package/dist/chunks/doubleBracket-B5nqIccY.js.map +1 -0
- package/dist/chunks/{echo-Gmh-b8f5.js → echo-_hDVbupR.js} +5 -5
- package/dist/chunks/echo-_hDVbupR.js.map +1 -0
- package/dist/chunks/{eval-DINS_Vhl.js → eval-4uLqmhXl.js} +5 -5
- package/dist/chunks/eval-4uLqmhXl.js.map +1 -0
- package/dist/chunks/false-D6AWAlcU.js +12 -0
- package/dist/chunks/false-D6AWAlcU.js.map +1 -0
- package/dist/chunks/{fortune-DkIZpYa_.js → fortune-D8ZK6xtX.js} +7 -7
- package/dist/chunks/fortune-D8ZK6xtX.js.map +1 -0
- package/dist/chunks/grep-DZO92KaH.js +41 -0
- package/dist/chunks/grep-DZO92KaH.js.map +1 -0
- package/dist/chunks/head-C_bbNyUc.js +50 -0
- package/dist/chunks/head-C_bbNyUc.js.map +1 -0
- package/dist/chunks/help-OHTeCzgo.js +19 -0
- package/dist/chunks/help-OHTeCzgo.js.map +1 -0
- package/dist/chunks/history-DeQor0w1.js +17 -0
- package/dist/chunks/history-DeQor0w1.js.map +1 -0
- package/dist/chunks/hostname-B-lPyRps.js +10 -0
- package/dist/chunks/hostname-B-lPyRps.js.map +1 -0
- package/dist/chunks/install-9Dikj7i2.js +27 -0
- package/dist/chunks/install-9Dikj7i2.js.map +1 -0
- package/dist/chunks/less-wELkkcQx.js +98 -0
- package/dist/chunks/less-wELkkcQx.js.map +1 -0
- package/dist/chunks/{lolcat-Dyjbg15t.js → lolcat-xpDAXsIt.js} +20 -20
- package/dist/chunks/lolcat-xpDAXsIt.js.map +1 -0
- package/dist/chunks/{ls-DnmR50y0.js → ls-D2Ln7mue.js} +7 -7
- package/dist/chunks/ls-D2Ln7mue.js.map +1 -0
- package/dist/chunks/man-E9nMmKZ1.js +58 -0
- package/dist/chunks/man-E9nMmKZ1.js.map +1 -0
- package/dist/chunks/nano-DsRjsQ-k.js +79 -0
- package/dist/chunks/nano-DsRjsQ-k.js.map +1 -0
- package/dist/chunks/neofetch-Dyre2Ik0.js +46 -0
- package/dist/chunks/neofetch-Dyre2Ik0.js.map +1 -0
- package/dist/chunks/pipes-CQ-pK6Kv.js +89 -0
- package/dist/chunks/pipes-CQ-pK6Kv.js.map +1 -0
- package/dist/chunks/printenv-Cq-skM9d.js +22 -0
- package/dist/chunks/printenv-Cq-skM9d.js.map +1 -0
- package/dist/chunks/pwd-CZ9IWAfu.js +11 -0
- package/dist/chunks/pwd-CZ9IWAfu.js.map +1 -0
- package/dist/chunks/rain-DT-V01dD.js +63 -0
- package/dist/chunks/rain-DT-V01dD.js.map +1 -0
- package/dist/chunks/reload-CE3ZVq6O.js +10 -0
- package/dist/chunks/reload-CE3ZVq6O.js.map +1 -0
- package/dist/chunks/rev-C5m1qeoZ.js +15 -0
- package/dist/chunks/rev-C5m1qeoZ.js.map +1 -0
- package/dist/chunks/rm-Uxuv-dEz.js.map +1 -1
- package/dist/chunks/rmdir-BYWer3pb.js.map +1 -1
- package/dist/chunks/sh-CIyBHb8C.js +11 -0
- package/dist/chunks/sh-CIyBHb8C.js.map +1 -0
- package/dist/chunks/{sl-CLAmugya.js → sl-CVLteJLH.js} +10 -10
- package/dist/chunks/{sl-CLAmugya.js.map → sl-CVLteJLH.js.map} +1 -1
- package/dist/chunks/sleep-hEBW30R3.js +26 -0
- package/dist/chunks/sleep-hEBW30R3.js.map +1 -0
- package/dist/chunks/snow-DAlyPPxX.js +76 -0
- package/dist/chunks/snow-DAlyPPxX.js.map +1 -0
- package/dist/chunks/tail-BLlaoTxA.js +50 -0
- package/dist/chunks/tail-BLlaoTxA.js.map +1 -0
- package/dist/chunks/terminalUIApp-Bmiaqvd9.js +63 -0
- package/dist/chunks/terminalUIApp-Bmiaqvd9.js.map +1 -0
- package/dist/chunks/textEditorApp-BM3EiMoV.js +56 -0
- package/dist/chunks/textEditorApp-BM3EiMoV.js.map +1 -0
- package/dist/chunks/true-j1Uf2Nz9.js +12 -0
- package/dist/chunks/true-j1Uf2Nz9.js.map +1 -0
- package/dist/chunks/uniq-LncLpnFY.js +44 -0
- package/dist/chunks/uniq-LncLpnFY.js.map +1 -0
- package/dist/chunks/uptime-pYltXMOi.js +10 -0
- package/dist/chunks/uptime-pYltXMOi.js.map +1 -0
- package/dist/chunks/vi-Cgo3qLR9.js +121 -0
- package/dist/chunks/vi-Cgo3qLR9.js.map +1 -0
- package/dist/chunks/watch-B4Tgzgbn.js +53 -0
- package/dist/chunks/watch-B4Tgzgbn.js.map +1 -0
- package/dist/chunks/whatis-BPKA-MNF.js +17 -0
- package/dist/chunks/whatis-BPKA-MNF.js.map +1 -0
- package/dist/chunks/whoami-BS3xdQEI.js +10 -0
- package/dist/chunks/whoami-BS3xdQEI.js.map +1 -0
- package/dist/chunks/yes-ilM2l2xq.js +18 -0
- package/dist/chunks/yes-ilM2l2xq.js.map +1 -0
- package/dist/main.d.ts +803 -73
- package/dist/main.js +17714 -16034
- package/dist/main.js.map +1 -1
- package/package.json +19 -18
- package/dist/chunks/cat-DH-kPf08.js +0 -44
- package/dist/chunks/cat-DH-kPf08.js.map +0 -1
- package/dist/chunks/clear-DC-frUcf.js +0 -13
- package/dist/chunks/clear-DC-frUcf.js.map +0 -1
- package/dist/chunks/compgen-OhvISbst.js +0 -11
- package/dist/chunks/compgen-OhvISbst.js.map +0 -1
- package/dist/chunks/cowsay-hTKzWScw.js.map +0 -1
- package/dist/chunks/date-D8cnHZuY.js +0 -33
- package/dist/chunks/date-D8cnHZuY.js.map +0 -1
- package/dist/chunks/dir-BmNeEPzy.js +0 -11
- package/dist/chunks/dir-BmNeEPzy.js.map +0 -1
- package/dist/chunks/echo-Gmh-b8f5.js.map +0 -1
- package/dist/chunks/eval-DINS_Vhl.js.map +0 -1
- package/dist/chunks/fortune-DkIZpYa_.js.map +0 -1
- package/dist/chunks/grep-CR3FMStR.js +0 -41
- package/dist/chunks/grep-CR3FMStR.js.map +0 -1
- package/dist/chunks/help-Drx0UDCY.js +0 -19
- package/dist/chunks/help-Drx0UDCY.js.map +0 -1
- package/dist/chunks/history-BEJhnsrb.js +0 -17
- package/dist/chunks/history-BEJhnsrb.js.map +0 -1
- package/dist/chunks/hostname-D8sxyWIy.js +0 -10
- package/dist/chunks/hostname-D8sxyWIy.js.map +0 -1
- package/dist/chunks/lolcat-Dyjbg15t.js.map +0 -1
- package/dist/chunks/ls-DnmR50y0.js.map +0 -1
- package/dist/chunks/man-7W6T7lda.js +0 -60
- package/dist/chunks/man-7W6T7lda.js.map +0 -1
- package/dist/chunks/neofetch--vHMIS9v.js +0 -40
- package/dist/chunks/neofetch--vHMIS9v.js.map +0 -1
- package/dist/chunks/printenv-6OpJKd7g.js +0 -24
- package/dist/chunks/printenv-6OpJKd7g.js.map +0 -1
- package/dist/chunks/pwd-9JYDUbov.js +0 -11
- package/dist/chunks/pwd-9JYDUbov.js.map +0 -1
- package/dist/chunks/reload-CjTJVt5Z.js +0 -10
- package/dist/chunks/reload-CjTJVt5Z.js.map +0 -1
- package/dist/chunks/rev--2pyt1P8.js +0 -12
- package/dist/chunks/rev--2pyt1P8.js.map +0 -1
- package/dist/chunks/sh-B67OTc-j.js +0 -15
- package/dist/chunks/sh-B67OTc-j.js.map +0 -1
- package/dist/chunks/uniq-Dx_4r3B5.js +0 -44
- package/dist/chunks/uniq-Dx_4r3B5.js.map +0 -1
- package/dist/chunks/uptime-DjJ5V7hu.js +0 -10
- package/dist/chunks/uptime-DjJ5V7hu.js.map +0 -1
- package/dist/chunks/watch-BjJ8bCnP.js +0 -52
- package/dist/chunks/watch-BjJ8bCnP.js.map +0 -1
- package/dist/chunks/whatis-CFZWdHZ4.js +0 -17
- package/dist/chunks/whatis-CFZWdHZ4.js.map +0 -1
- package/dist/chunks/whoami-D-es0JvS.js +0 -10
- package/dist/chunks/whoami-D-es0JvS.js.map +0 -1
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Command as o, Shell as t } from "../main.js";
|
|
2
|
-
const u = new o().setManual({
|
|
3
|
-
purpose: "Execute a shell script"
|
|
4
|
-
}).setRequireArgs(!0).setExecute(async function(r, { stderr: n, workingDirectory: i, shell: s }) {
|
|
5
|
-
const a = r[0], e = i.navigateToFile(a);
|
|
6
|
-
if (!e) {
|
|
7
|
-
t.writeError(n, this.name, t.INVALID_PATH_ERROR);
|
|
8
|
-
return;
|
|
9
|
-
}
|
|
10
|
-
return await s.interpreter.executeScript(e);
|
|
11
|
-
});
|
|
12
|
-
export {
|
|
13
|
-
u as sh
|
|
14
|
-
};
|
|
15
|
-
//# sourceMappingURL=sh-B67OTc-j.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sh-B67OTc-j.js","sources":["../../src/features/shell/commands/sh.ts"],"sourcesContent":["import { Command } from \"../command\";\nimport { Shell } from \"../shell\";\n\nexport const sh = new Command()\n\t.setManual({\n\t\tpurpose: \"Execute a shell script\",\n\t})\n\t.setRequireArgs(true)\n\t.setExecute(async function(this: Command, args, { stderr, workingDirectory, shell }) {\n\t\tconst path = args[0];\n\t\tconst file = workingDirectory.navigateToFile(path);\n\n\t\tif (!file) {\n\t\t\tShell.writeError(stderr, this.name, Shell.INVALID_PATH_ERROR);\n\t\t\treturn;\n\t\t}\n\n\t\treturn await shell.interpreter.executeScript(file);\n\t});"],"names":["sh","Command","args","stderr","workingDirectory","shell","path","file","Shell"],"mappings":";AAGO,MAAMA,IAAK,IAAIC,EAAA,EACpB,UAAU;AAAA,EACV,SAAS;AACV,CAAC,EACA,eAAe,EAAI,EACnB,WAAW,eAA8BC,GAAM,EAAE,QAAAC,GAAQ,kBAAAC,GAAkB,OAAAC,KAAS;AACpF,QAAMC,IAAOJ,EAAK,CAAC,GACbK,IAAOH,EAAiB,eAAeE,CAAI;AAEjD,MAAI,CAACC,GAAM;AACV,IAAAC,EAAM,WAAWL,GAAQ,KAAK,MAAMK,EAAM,kBAAkB;AAC5D;AAAA,EACD;AAEA,SAAO,MAAMH,EAAM,YAAY,cAAcE,CAAI;AAClD,CAAC;"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { Command as P, Shell as a, EXIT_CODE as g } from "../main.js";
|
|
2
|
-
const E = new P().setManual({
|
|
3
|
-
purpose: "Report or omit repeated lines",
|
|
4
|
-
usage: "uniq [OPTION]... [INPUT [OUTPUT]]",
|
|
5
|
-
description: "Filter adjacent matching lines from INPUT, writing to OUTPUT.",
|
|
6
|
-
options: {
|
|
7
|
-
"-c": "Prefix lines by the number of occurrences",
|
|
8
|
-
"-d": "Only print duplicate lines, one for each group",
|
|
9
|
-
"-u": "Only print unique lines",
|
|
10
|
-
"-i": "Ignore differences in case when comparing"
|
|
11
|
-
}
|
|
12
|
-
}).addOption({ short: "c", long: "count" }).addOption({ short: "d", long: "repeated" }).addOption({ short: "u", long: "unique" }).addOption({ short: "i", long: "ignore-case" }).setExecute(async function(h, { stdout: O, stderr: l, stdin: m, workingDirectory: w, options: o }) {
|
|
13
|
-
const d = (n) => {
|
|
14
|
-
if (!n.length) return;
|
|
15
|
-
const t = n.split(`
|
|
16
|
-
`), p = o.includes("i"), I = o.includes("c"), T = o.includes("d"), U = o.includes("u");
|
|
17
|
-
let r = t[0], s = 0;
|
|
18
|
-
const f = (i, c) => {
|
|
19
|
-
const u = c > 1;
|
|
20
|
-
if (T && !u || U && u) return;
|
|
21
|
-
const y = I ? `${c.toString().padStart(7, " ")} ` : "";
|
|
22
|
-
O.write(y + i);
|
|
23
|
-
};
|
|
24
|
-
for (const i of t) {
|
|
25
|
-
const c = p ? i.toLowerCase() : i, u = p ? r.toLowerCase() : r;
|
|
26
|
-
c === u ? s++ : (f(r, s), r = i, s = 1);
|
|
27
|
-
}
|
|
28
|
-
f(r, s);
|
|
29
|
-
}, e = h[0];
|
|
30
|
-
if (e && e !== "-") {
|
|
31
|
-
const n = w.navigate(e);
|
|
32
|
-
if (!n)
|
|
33
|
-
return a.writeError(l, this.name, `${e}: ${a.INVALID_PATH_ERROR}`);
|
|
34
|
-
if (n.isFolder())
|
|
35
|
-
return a.writeError(l, this.name, `${e}: Is a directory`);
|
|
36
|
-
const t = await n.read();
|
|
37
|
-
return t != null && d(t), g.success;
|
|
38
|
-
}
|
|
39
|
-
return a.readInput("", m, (n) => (d(n), g.success));
|
|
40
|
-
});
|
|
41
|
-
export {
|
|
42
|
-
E as uniq
|
|
43
|
-
};
|
|
44
|
-
//# sourceMappingURL=uniq-Dx_4r3B5.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"uniq-Dx_4r3B5.js","sources":["../../src/features/shell/commands/uniq.ts"],"sourcesContent":["import { EXIT_CODE } from \"../../../constants\";\nimport { Command } from \"../command\";\nimport { Shell } from \"../shell\";\n\nexport const uniq = new Command()\n\t.setManual({\n\t\tpurpose: \"Report or omit repeated lines\",\n\t\tusage: \"uniq [OPTION]... [INPUT [OUTPUT]]\",\n\t\tdescription: \"Filter adjacent matching lines from INPUT, writing to OUTPUT.\",\n\t\toptions: {\n\t\t\t\"-c\": \"Prefix lines by the number of occurrences\",\n\t\t\t\"-d\": \"Only print duplicate lines, one for each group\",\n\t\t\t\"-u\": \"Only print unique lines\",\n\t\t\t\"-i\": \"Ignore differences in case when comparing\",\n\t\t},\n\t})\n\t.addOption({ short: \"c\", long: \"count\" })\n\t.addOption({ short: \"d\", long: \"repeated\" })\n\t.addOption({ short: \"u\", long: \"unique\" })\n\t.addOption({ short: \"i\", long: \"ignore-case\" })\n\t.setExecute(async function(this: Command, args, { stdout, stderr, stdin, workingDirectory, options }) {\n\t\tconst processUniq = (text: string) => {\n\t\t\tif (!text.length) return;\n\n\t\t\tconst lines = text.split(\"\\n\");\n\t\t\tconst ignoreCase = options.includes(\"i\");\n\t\t\tconst showCount = options.includes(\"c\");\n\t\t\tconst onlyDuplicates = options.includes(\"d\");\n\t\t\tconst onlyUnique = options.includes(\"u\");\n\n\t\t\tlet currentLine = lines[0];\n\t\t\tlet count = 0;\n\n\t\t\tconst outputLine = (line: string, lineCount: number) => {\n\t\t\t\tconst isDuplicate = lineCount > 1;\n\t\t\t\tif (onlyDuplicates && !isDuplicate) return;\n\t\t\t\tif (onlyUnique && isDuplicate) return;\n\n\t\t\t\tconst prefix = showCount ? `${lineCount.toString().padStart(7, \" \")} ` : \"\";\n\t\t\t\tstdout.write(prefix + line);\n\t\t\t};\n\n\t\t\tfor (const line of lines) {\n\t\t\t\tconst a = ignoreCase ? line.toLowerCase() : line;\n\t\t\t\tconst b = ignoreCase ? currentLine.toLowerCase() : currentLine;\n\n\t\t\t\tif (a === b) {\n\t\t\t\t\tcount++;\n\t\t\t\t} else {\n\t\t\t\t\toutputLine(currentLine, count);\n\t\t\t\t\tcurrentLine = line;\n\t\t\t\t\tcount = 1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\toutputLine(currentLine, count);\n\t\t};\n\n\t\tconst path = args[0];\n\n\t\tif (path && path !== \"-\") {\n\t\t\tconst target = workingDirectory.navigate(path);\n\n\t\t\tif (!target)\n\t\t\t\treturn Shell.writeError(stderr, this.name, `${path}: ${Shell.INVALID_PATH_ERROR}`);\n\t\t\tif (target.isFolder())\n\t\t\t\treturn Shell.writeError(stderr, this.name, `${path}: Is a directory`);\n\n\t\t\tconst content = await target.read();\n\t\t\tif (content != null) processUniq(content);\n\t\t\treturn EXIT_CODE.success;\n\t\t}\n\n\t\treturn Shell.readInput(\"\", stdin, (data) => {\n\t\t\tprocessUniq(data);\n\t\t\treturn EXIT_CODE.success;\n\t\t});\n\t});"],"names":["uniq","Command","args","stdout","stderr","stdin","workingDirectory","options","processUniq","text","lines","ignoreCase","showCount","onlyDuplicates","onlyUnique","currentLine","count","outputLine","line","lineCount","isDuplicate","prefix","a","b","path","target","Shell","content","EXIT_CODE","data"],"mappings":";AAIO,MAAMA,IAAO,IAAIC,EAAA,EACtB,UAAU;AAAA,EACV,SAAS;AAAA,EACT,OAAO;AAAA,EACP,aAAa;AAAA,EACb,SAAS;AAAA,IACR,MAAM;AAAA,IACN,MAAM;AAAA,IACN,MAAM;AAAA,IACN,MAAM;AAAA,EAAA;AAER,CAAC,EACA,UAAU,EAAE,OAAO,KAAK,MAAM,SAAS,EACvC,UAAU,EAAE,OAAO,KAAK,MAAM,WAAA,CAAY,EAC1C,UAAU,EAAE,OAAO,KAAK,MAAM,SAAA,CAAU,EACxC,UAAU,EAAE,OAAO,KAAK,MAAM,cAAA,CAAe,EAC7C,WAAW,eAA8BC,GAAM,EAAE,QAAAC,GAAQ,QAAAC,GAAQ,OAAAC,GAAO,kBAAAC,GAAkB,SAAAC,KAAW;AACrG,QAAMC,IAAc,CAACC,MAAiB;AACrC,QAAI,CAACA,EAAK,OAAQ;AAElB,UAAMC,IAAQD,EAAK,MAAM;AAAA,CAAI,GACvBE,IAAaJ,EAAQ,SAAS,GAAG,GACjCK,IAAYL,EAAQ,SAAS,GAAG,GAChCM,IAAiBN,EAAQ,SAAS,GAAG,GACrCO,IAAaP,EAAQ,SAAS,GAAG;AAEvC,QAAIQ,IAAcL,EAAM,CAAC,GACrBM,IAAQ;AAEZ,UAAMC,IAAa,CAACC,GAAcC,MAAsB;AACvD,YAAMC,IAAcD,IAAY;AAEhC,UADIN,KAAkB,CAACO,KACnBN,KAAcM,EAAa;AAE/B,YAAMC,IAAST,IAAY,GAAGO,EAAU,SAAA,EAAW,SAAS,GAAG,GAAG,CAAC,MAAM;AACzE,MAAAhB,EAAO,MAAMkB,IAASH,CAAI;AAAA,IAC3B;AAEA,eAAWA,KAAQR,GAAO;AACzB,YAAMY,IAAIX,IAAaO,EAAK,YAAA,IAAgBA,GACtCK,IAAIZ,IAAaI,EAAY,YAAA,IAAgBA;AAEnD,MAAIO,MAAMC,IACTP,OAEAC,EAAWF,GAAaC,CAAK,GAC7BD,IAAcG,GACdF,IAAQ;AAAA,IAEV;AAEA,IAAAC,EAAWF,GAAaC,CAAK;AAAA,EAC9B,GAEMQ,IAAOtB,EAAK,CAAC;AAEnB,MAAIsB,KAAQA,MAAS,KAAK;AACzB,UAAMC,IAASnB,EAAiB,SAASkB,CAAI;AAE7C,QAAI,CAACC;AACJ,aAAOC,EAAM,WAAWtB,GAAQ,KAAK,MAAM,GAAGoB,CAAI,KAAKE,EAAM,kBAAkB,EAAE;AAClF,QAAID,EAAO,SAAA;AACV,aAAOC,EAAM,WAAWtB,GAAQ,KAAK,MAAM,GAAGoB,CAAI,kBAAkB;AAErE,UAAMG,IAAU,MAAMF,EAAO,KAAA;AAC7B,WAAIE,KAAW,QAAMnB,EAAYmB,CAAO,GACjCC,EAAU;AAAA,EAClB;AAEA,SAAOF,EAAM,UAAU,IAAIrB,GAAO,CAACwB,OAClCrB,EAAYqB,CAAI,GACTD,EAAU,QACjB;AACF,CAAC;"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Command as m } from "../main.js";
|
|
2
|
-
const o = new m().setManual({
|
|
3
|
-
purpose: "Display the current uptime of the system"
|
|
4
|
-
}).setExecute(function(p, { systemManager: e, stdout: t }) {
|
|
5
|
-
t.write(`Uptime: ${e.getUptime(2)}`);
|
|
6
|
-
});
|
|
7
|
-
export {
|
|
8
|
-
o as uptime
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=uptime-DjJ5V7hu.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"uptime-DjJ5V7hu.js","sources":["../../src/features/shell/commands/uptime.ts"],"sourcesContent":["import { Command } from \"../command\";\n\nexport const uptime = new Command()\n\t.setManual({\n\t\tpurpose: \"Display the current uptime of the system\",\n\t})\n\t.setExecute(function(_args, { systemManager, stdout }) {\n\t\tstdout.write(`Uptime: ${systemManager.getUptime(2)}`);\n\t});"],"names":["uptime","Command","_args","systemManager","stdout"],"mappings":";AAEO,MAAMA,IAAS,IAAIC,EAAA,EACxB,UAAU;AAAA,EACV,SAAS;AACV,CAAC,EACA,WAAW,SAASC,GAAO,EAAE,eAAAC,GAAe,QAAAC,KAAU;AACtD,EAAAA,EAAO,MAAM,WAAWD,EAAc,UAAU,CAAC,CAAC,EAAE;AACrD,CAAC;"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { Command as S, Stream as i, EXIT_CODE as x, Shell as p } from "../main.js";
|
|
2
|
-
import { parseOptionalFloat as I, ANSI as t, Ansi as O } from "@prozilla-os/shared";
|
|
3
|
-
const M = new S().setRequireArgs(!0).setManual({
|
|
4
|
-
purpose: "Execute a program periodically, showing output fullscreen",
|
|
5
|
-
usage: "watch [-n <seconds>] [-t] <command>",
|
|
6
|
-
options: {
|
|
7
|
-
"-n seconds": "Set the interval (defaults to 2)",
|
|
8
|
-
"-t": "Turn off the header showing the interval and command name"
|
|
9
|
-
}
|
|
10
|
-
}).addOption({
|
|
11
|
-
long: "interval",
|
|
12
|
-
short: "n",
|
|
13
|
-
isInput: !0
|
|
14
|
-
}).addOption({
|
|
15
|
-
long: "no-title",
|
|
16
|
-
short: "t",
|
|
17
|
-
isInput: !1
|
|
18
|
-
}).setExecute(function(m, { inputs: f, options: h, shell: w, stdout: r, stdin: c, stderr: E }) {
|
|
19
|
-
const l = I(f.n, 2), v = Math.max(0.1, l) * 1e3, g = h.includes("t"), n = m.join(" ");
|
|
20
|
-
let o = !1, a = !1;
|
|
21
|
-
r.write(t.screen.enterAltBuffer);
|
|
22
|
-
const u = async () => {
|
|
23
|
-
if (o || a) return;
|
|
24
|
-
o = !0;
|
|
25
|
-
const s = new i().start();
|
|
26
|
-
let d = "";
|
|
27
|
-
s.on(i.DATA_EVENT, (e) => {
|
|
28
|
-
d += e;
|
|
29
|
-
});
|
|
30
|
-
try {
|
|
31
|
-
if (await w.interpreter.execute(n, { stdout: s }), !a) {
|
|
32
|
-
const e = g ? "" : O.white(`Every ${l.toFixed(1)}s: ${n}
|
|
33
|
-
|
|
34
|
-
`);
|
|
35
|
-
r.write(t.screen.clear + t.screen.home + e + d);
|
|
36
|
-
}
|
|
37
|
-
} catch (e) {
|
|
38
|
-
console.error(e), p.writeError(E, this.name, [p.COMMAND_FAILED_ERROR, n]);
|
|
39
|
-
} finally {
|
|
40
|
-
o = !1, s.stop();
|
|
41
|
-
}
|
|
42
|
-
}, A = setInterval(() => {
|
|
43
|
-
u();
|
|
44
|
-
}, v);
|
|
45
|
-
return c.on(i.STOP_EVENT, () => {
|
|
46
|
-
a = !0, clearInterval(A), r.write(t.screen.exitAltBuffer);
|
|
47
|
-
}), u(), c.wait(x.success);
|
|
48
|
-
});
|
|
49
|
-
export {
|
|
50
|
-
M as watch
|
|
51
|
-
};
|
|
52
|
-
//# sourceMappingURL=watch-BjJ8bCnP.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"watch-BjJ8bCnP.js","sources":["../../src/features/shell/commands/watch.ts"],"sourcesContent":["import { EXIT_CODE } from \"../../../constants\";\nimport { Command } from \"../command\";\nimport { Stream } from \"../stream\";\nimport { ANSI, Ansi, parseOptionalFloat } from \"@prozilla-os/shared\";\nimport { Shell } from \"../shell\";\n\nexport const watch = new Command()\n\t.setRequireArgs(true)\n\t.setManual({\n\t\tpurpose: \"Execute a program periodically, showing output fullscreen\",\n\t\tusage: \"watch [-n <seconds>] [-t] <command>\",\n\t\toptions: {\n\t\t\t\"-n seconds\": \"Set the interval (defaults to 2)\",\n\t\t\t\"-t\": \"Turn off the header showing the interval and command name\",\n\t\t},\n\t})\n\t.addOption({\n\t\tlong: \"interval\",\n\t\tshort: \"n\",\n\t\tisInput: true,\n\t})\n\t.addOption({\n\t\tlong: \"no-title\",\n\t\tshort: \"t\",\n\t\tisInput: false,\n\t})\n\t.setExecute(function(this: Command, args, { inputs, options, shell, stdout, stdin, stderr }) {\n\t\tconst intervalSeconds = parseOptionalFloat(inputs.n, 2);\n\t\tconst intervalMs = Math.max(0.1, intervalSeconds) * 1000;\n\t\tconst hideHeader = options.includes(\"t\");\n\t\t\n\t\tconst commandString = args.join(\" \");\n\t\tlet isExecuting = false;\n\t\tlet isStopping = false;\n\n\t\tstdout.write(ANSI.screen.enterAltBuffer);\n\n\t\tconst tick = async () => {\n\t\t\tif (isExecuting || isStopping) return;\n\t\t\tisExecuting = true;\n\n\t\t\tconst captureStream = new Stream().start();\n\t\t\tlet capturedOutput = \"\";\n\n\t\t\tcaptureStream.on(Stream.DATA_EVENT, (data) => {\n\t\t\t\tcapturedOutput += data;\n\t\t\t});\n\n\t\t\ttry {\n\t\t\t\tawait shell.interpreter.execute(commandString, { stdout: captureStream });\n\t\t\t\t\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n\t\t\t\tif (!isStopping) {\n\t\t\t\t\tconst header = hideHeader \n\t\t\t\t\t\t? \"\" \n\t\t\t\t\t\t: Ansi.white(`Every ${intervalSeconds.toFixed(1)}s: ${commandString}\\n\\n`);\n\t\t\t\t\t\n\t\t\t\t\tstdout.write(ANSI.screen.clear + ANSI.screen.home + header + capturedOutput);\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error(error);\n\t\t\t\tShell.writeError(stderr, this.name, [Shell.COMMAND_FAILED_ERROR, commandString]);\n\t\t\t} finally {\n\t\t\t\tisExecuting = false;\n\t\t\t\tcaptureStream.stop();\n\t\t\t}\n\t\t};\n\n\t\tconst intervalId = setInterval(() => void tick(), intervalMs);\n\n\t\tstdin.on(Stream.STOP_EVENT, () => {\n\t\t\tisStopping = true;\n\t\t\tclearInterval(intervalId);\n\t\t\tstdout.write(ANSI.screen.exitAltBuffer);\n\t\t});\n\n\t\tvoid tick();\n\n\t\treturn stdin.wait(EXIT_CODE.success);\n\t});"],"names":["watch","Command","args","inputs","options","shell","stdout","stdin","stderr","intervalSeconds","parseOptionalFloat","intervalMs","hideHeader","commandString","isExecuting","isStopping","ANSI","tick","captureStream","Stream","capturedOutput","data","header","Ansi","error","Shell","intervalId","EXIT_CODE"],"mappings":";;AAMO,MAAMA,IAAQ,IAAIC,EAAA,EACvB,eAAe,EAAI,EACnB,UAAU;AAAA,EACV,SAAS;AAAA,EACT,OAAO;AAAA,EACP,SAAS;AAAA,IACR,cAAc;AAAA,IACd,MAAM;AAAA,EAAA;AAER,CAAC,EACA,UAAU;AAAA,EACV,MAAM;AAAA,EACN,OAAO;AAAA,EACP,SAAS;AACV,CAAC,EACA,UAAU;AAAA,EACV,MAAM;AAAA,EACN,OAAO;AAAA,EACP,SAAS;AACV,CAAC,EACA,WAAW,SAAwBC,GAAM,EAAE,QAAAC,GAAQ,SAAAC,GAAS,OAAAC,GAAO,QAAAC,GAAQ,OAAAC,GAAO,QAAAC,KAAU;AAC5F,QAAMC,IAAkBC,EAAmBP,EAAO,GAAG,CAAC,GAChDQ,IAAa,KAAK,IAAI,KAAKF,CAAe,IAAI,KAC9CG,IAAaR,EAAQ,SAAS,GAAG,GAEjCS,IAAgBX,EAAK,KAAK,GAAG;AACnC,MAAIY,IAAc,IACdC,IAAa;AAEjB,EAAAT,EAAO,MAAMU,EAAK,OAAO,cAAc;AAEvC,QAAMC,IAAO,YAAY;AACxB,QAAIH,KAAeC,EAAY;AAC/B,IAAAD,IAAc;AAEd,UAAMI,IAAgB,IAAIC,EAAA,EAAS,MAAA;AACnC,QAAIC,IAAiB;AAErB,IAAAF,EAAc,GAAGC,EAAO,YAAY,CAACE,MAAS;AAC7C,MAAAD,KAAkBC;AAAA,IACnB,CAAC;AAED,QAAI;AAIH,UAHA,MAAMhB,EAAM,YAAY,QAAQQ,GAAe,EAAE,QAAQK,GAAe,GAGpE,CAACH,GAAY;AAChB,cAAMO,IAASV,IACZ,KACAW,EAAK,MAAM,SAASd,EAAgB,QAAQ,CAAC,CAAC,MAAMI,CAAa;AAAA;AAAA,CAAM;AAE1E,QAAAP,EAAO,MAAMU,EAAK,OAAO,QAAQA,EAAK,OAAO,OAAOM,IAASF,CAAc;AAAA,MAC5E;AAAA,IACD,SAASI,GAAO;AACf,cAAQ,MAAMA,CAAK,GACnBC,EAAM,WAAWjB,GAAQ,KAAK,MAAM,CAACiB,EAAM,sBAAsBZ,CAAa,CAAC;AAAA,IAChF,UAAA;AACC,MAAAC,IAAc,IACdI,EAAc,KAAA;AAAA,IACf;AAAA,EACD,GAEMQ,IAAa,YAAY,MAAA;AAAM,IAAKT,EAAA;AAAA,KAAQN,CAAU;AAE5D,SAAAJ,EAAM,GAAGY,EAAO,YAAY,MAAM;AACjC,IAAAJ,IAAa,IACb,cAAcW,CAAU,GACxBpB,EAAO,MAAMU,EAAK,OAAO,aAAa;AAAA,EACvC,CAAC,GAEIC,EAAA,GAEEV,EAAM,KAAKoB,EAAU,OAAO;AACpC,CAAC;"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Ansi as m } from "@prozilla-os/shared";
|
|
2
|
-
import { Command as i, CommandsManager as s, Shell as e } from "../main.js";
|
|
3
|
-
const p = new i().setRequireArgs(!0).setManual({
|
|
4
|
-
purpose: "Show information about a command"
|
|
5
|
-
}).setExecute(function(t, { stdout: a, stderr: r }) {
|
|
6
|
-
const o = t[0].toLowerCase(), n = s.find(o);
|
|
7
|
-
if (!n)
|
|
8
|
-
return e.writeError(r, this.name, `${o}: Command not found`);
|
|
9
|
-
if (!n.manual?.purpose)
|
|
10
|
-
return e.writeError(r, this.name, `${o}: No information found`);
|
|
11
|
-
a.write(`${o} - ${m.green(n.manual.purpose)}
|
|
12
|
-
`);
|
|
13
|
-
});
|
|
14
|
-
export {
|
|
15
|
-
p as whatis
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=whatis-CFZWdHZ4.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"whatis-CFZWdHZ4.js","sources":["../../src/features/shell/commands/whatis.ts"],"sourcesContent":["import { Ansi } from \"@prozilla-os/shared\";\nimport { Shell } from \"../shell\";\nimport { Command } from \"../command\";\nimport { CommandsManager } from \"../commands\";\n\nexport const whatis = new Command()\n\t.setRequireArgs(true)\n\t.setManual({\n\t\tpurpose: \"Show information about a command\",\n\t})\n\t.setExecute(function(this: Command, args: string[], { stdout, stderr }) {\n\t\tconst commandName = args[0].toLowerCase();\n\t\tconst command = CommandsManager.find(commandName);\n\n\t\tif (!command)\n\t\t\treturn Shell.writeError(stderr, this.name, `${commandName}: Command not found`);\n\n\t\tif (!command.manual?.purpose)\n\t\t\treturn Shell.writeError(stderr, this.name, `${commandName}: No information found`);\n\n\t\tstdout.write(`${commandName} - ${Ansi.green(command.manual.purpose)}\\n`);\n\t});"],"names":["whatis","Command","args","stdout","stderr","commandName","command","CommandsManager","Shell","Ansi"],"mappings":";;AAKO,MAAMA,IAAS,IAAIC,EAAA,EACxB,eAAe,EAAI,EACnB,UAAU;AAAA,EACV,SAAS;AACV,CAAC,EACA,WAAW,SAAwBC,GAAgB,EAAE,QAAAC,GAAQ,QAAAC,KAAU;AACvE,QAAMC,IAAcH,EAAK,CAAC,EAAE,YAAA,GACtBI,IAAUC,EAAgB,KAAKF,CAAW;AAEhD,MAAI,CAACC;AACJ,WAAOE,EAAM,WAAWJ,GAAQ,KAAK,MAAM,GAAGC,CAAW,qBAAqB;AAE/E,MAAI,CAACC,EAAQ,QAAQ;AACpB,WAAOE,EAAM,WAAWJ,GAAQ,KAAK,MAAM,GAAGC,CAAW,wBAAwB;AAElF,EAAAF,EAAO,MAAM,GAAGE,CAAW,MAAMI,EAAK,MAAMH,EAAQ,OAAO,OAAO,CAAC;AAAA,CAAI;AACxE,CAAC;"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Command as o } from "../main.js";
|
|
2
|
-
const r = new o().setManual({
|
|
3
|
-
purpose: "Display the username"
|
|
4
|
-
}).setExecute(function(a, { username: e, stdout: t }) {
|
|
5
|
-
t.write(e);
|
|
6
|
-
});
|
|
7
|
-
export {
|
|
8
|
-
r as whoami
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=whoami-D-es0JvS.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"whoami-D-es0JvS.js","sources":["../../src/features/shell/commands/whoami.ts"],"sourcesContent":["import { Command } from \"../command\";\n\nexport const whoami = new Command()\n\t.setManual({\n\t\tpurpose: \"Display the username\",\n\t})\n\t.setExecute(function (_args, { username, stdout }) {\n\t\tstdout.write(username);\n\t});"],"names":["whoami","Command","_args","username","stdout"],"mappings":";AAEO,MAAMA,IAAS,IAAIC,EAAA,EACxB,UAAU;AAAA,EACV,SAAS;AACV,CAAC,EACA,WAAW,SAAUC,GAAO,EAAE,UAAAC,GAAU,QAAAC,KAAW;AACnD,EAAAA,EAAO,MAAMD,CAAQ;AACtB,CAAC;"}
|