@lifo-sh/core 0.5.0 → 0.5.6
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/dist/args-BhoL0JcG.js +58 -0
- package/dist/awk-DahiO6Jl.js +170 -0
- package/dist/base64-Dj_AnQAH.js +92 -0
- package/dist/basename-D8sjWfzX.js +14 -0
- package/dist/bc-CCuJi0IY.js +230 -0
- package/dist/browser-B0dadKCA.js +43 -0
- package/dist/cal-DQsLvArw.js +85 -0
- package/dist/cat-KYGveROo.js +32 -0
- package/dist/chmod-gYZdg3Kv.js +81 -0
- package/dist/chown-DoPi7NLO.js +32 -0
- package/dist/commands/net/curl.d.ts +2 -2
- package/dist/commands/net/curl.d.ts.map +1 -1
- package/dist/commands/net/forward.d.ts +14 -0
- package/dist/commands/net/forward.d.ts.map +1 -0
- package/dist/commands/net/host.d.ts +14 -0
- package/dist/commands/net/host.d.ts.map +1 -0
- package/dist/commands/net/ifconfig.d.ts +8 -0
- package/dist/commands/net/ifconfig.d.ts.map +1 -0
- package/dist/commands/net/ip.d.ts +14 -0
- package/dist/commands/net/ip.d.ts.map +1 -0
- package/dist/commands/net/netstat.d.ts +8 -0
- package/dist/commands/net/netstat.d.ts.map +1 -0
- package/dist/commands/net/ports.d.ts +8 -0
- package/dist/commands/net/ports.d.ts.map +1 -0
- package/dist/commands/net/route.d.ts +8 -0
- package/dist/commands/net/route.d.ts.map +1 -0
- package/dist/commands/net/test-registry.d.ts +8 -0
- package/dist/commands/net/test-registry.d.ts.map +1 -0
- package/dist/commands/net/tunnel-v2.d.ts +4 -0
- package/dist/commands/net/tunnel-v2.d.ts.map +1 -0
- package/dist/commands/net/tunnel.d.ts +6 -0
- package/dist/commands/net/tunnel.d.ts.map +1 -0
- package/dist/commands/registry.d.ts +1 -0
- package/dist/commands/registry.d.ts.map +1 -1
- package/dist/commands/system/kill.d.ts +2 -2
- package/dist/commands/system/kill.d.ts.map +1 -1
- package/dist/commands/system/lifo.d.ts +19 -2
- package/dist/commands/system/lifo.d.ts.map +1 -1
- package/dist/commands/system/newtab.d.ts +8 -0
- package/dist/commands/system/newtab.d.ts.map +1 -0
- package/dist/commands/system/node.d.ts +3 -2
- package/dist/commands/system/node.d.ts.map +1 -1
- package/dist/commands/system/npm.d.ts +20 -7
- package/dist/commands/system/npm.d.ts.map +1 -1
- package/dist/commands/system/ps.d.ts +3 -2
- package/dist/commands/system/ps.d.ts.map +1 -1
- package/dist/commands/system/systemctl.d.ts +4 -0
- package/dist/commands/system/systemctl.d.ts.map +1 -0
- package/dist/commands/system/top.d.ts +2 -2
- package/dist/commands/system/top.d.ts.map +1 -1
- package/dist/commands/system/watch.d.ts.map +1 -1
- package/dist/commands/system/whoami.d.ts.map +1 -1
- package/dist/commands/types.d.ts +3 -2
- package/dist/commands/types.d.ts.map +1 -1
- package/dist/cp-BP7-nkZi.js +29 -0
- package/dist/cut-Dg3Sxlw_.js +84 -0
- package/dist/date-DqL4oCg8.js +91 -0
- package/dist/df-CEHqyq91.js +47 -0
- package/dist/diff-aYLFp43G.js +250 -0
- package/dist/dig-0_V5UoWW.js +91 -0
- package/dist/dirname-ByojkmnI.js +14 -0
- package/dist/du-feoEC53Q.js +89 -0
- package/dist/env-CIcDulqw.js +10 -0
- package/dist/fastfetch-CRfsfb4t.js +378 -0
- package/dist/file-BHHCgjt9.js +79 -0
- package/dist/find-C-pGJyTZ.js +63 -0
- package/dist/free-DCkGta9v.js +33 -0
- package/dist/grep-Bv7fu1qw.js +179 -0
- package/dist/gunzip-BZk2000a.js +57 -0
- package/dist/gzip-D55LwDu8.js +70 -0
- package/dist/head-CQQ8pAha.js +66 -0
- package/dist/hostname-Ba0tnCzG.js +8 -0
- package/dist/index-GLjTMF7C.js +22717 -0
- package/dist/index.d.ts +44 -17
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +99 -72
- package/dist/less-C-8XcQ_A.js +294 -0
- package/dist/ln-CpXREm6e.js +15 -0
- package/dist/ls-Ce1mcASB.js +132 -0
- package/dist/{man-Dg26tZ-a.js → man-DjxHeM01.js} +46 -27
- package/dist/mime-B5knsVEw.js +101 -0
- package/dist/mkdir-CtDdaiaM.js +31 -0
- package/dist/mktemp-DwAY8Lz2.js +44 -0
- package/dist/mv-vS020rcy.js +29 -0
- package/dist/nano-DKfqXthq.js +445 -0
- package/dist/nl-DHh-MmKX.js +66 -0
- package/dist/ping-BQO3Z9CT.js +72 -0
- package/dist/pkg/PackageManager.d.ts +2 -2
- package/dist/pkg/PackageManager.d.ts.map +1 -1
- package/dist/pkg/lifo-dev.d.ts +6 -6
- package/dist/pkg/lifo-dev.d.ts.map +1 -1
- package/dist/pkg/lifo-runtime.d.ts +3 -3
- package/dist/pkg/lifo-runtime.d.ts.map +1 -1
- package/dist/pkg/loader.d.ts +2 -2
- package/dist/pkg/loader.d.ts.map +1 -1
- package/dist/printf-CdBVx2dT.js +81 -0
- package/dist/realpath-CZ_ja3FL.js +27 -0
- package/dist/rev-KZ9O5vNS.js +42 -0
- package/dist/rm-dW7YB25j.js +48 -0
- package/dist/rmdir-Db2wctQ6.js +42 -0
- package/dist/runtime/ContextSerialization.d.ts +7 -0
- package/dist/runtime/ContextSerialization.d.ts.map +1 -0
- package/dist/runtime/ProcessExecutor.d.ts +14 -0
- package/dist/runtime/ProcessExecutor.d.ts.map +1 -0
- package/dist/runtime/command-worker.d.ts +9 -0
- package/dist/runtime/command-worker.d.ts.map +1 -0
- package/dist/sandbox/Sandbox.d.ts +1 -2
- package/dist/sandbox/Sandbox.d.ts.map +1 -1
- package/dist/sandbox/SandboxFs.d.ts +2 -2
- package/dist/sandbox/SandboxFs.d.ts.map +1 -1
- package/dist/sandbox/types.d.ts +1 -2
- package/dist/sandbox/types.d.ts.map +1 -1
- package/dist/sed-BK_pjM2M.js +142 -0
- package/dist/seq-B0yurkx9.js +64 -0
- package/dist/sha256sum-BP0l9D35.js +85 -0
- package/dist/shell/ProcessRegistry.d.ts +152 -0
- package/dist/shell/ProcessRegistry.d.ts.map +1 -0
- package/dist/shell/ProcessRegistry.example.d.ts +8 -0
- package/dist/shell/ProcessRegistry.example.d.ts.map +1 -0
- package/dist/shell/ProcessRegistry.test.d.ts +2 -0
- package/dist/shell/ProcessRegistry.test.d.ts.map +1 -0
- package/dist/shell/Shell.d.ts +13 -4
- package/dist/shell/Shell.d.ts.map +1 -1
- package/dist/shell/completer.d.ts +2 -2
- package/dist/shell/completer.d.ts.map +1 -1
- package/dist/shell/expander.d.ts +2 -2
- package/dist/shell/expander.d.ts.map +1 -1
- package/dist/shell/history.d.ts +2 -2
- package/dist/shell/history.d.ts.map +1 -1
- package/dist/shell/interpreter.d.ts +8 -2
- package/dist/shell/interpreter.d.ts.map +1 -1
- package/dist/shell/test-builtin.d.ts +2 -2
- package/dist/shell/test-builtin.d.ts.map +1 -1
- package/dist/sl-BmMNz7ir.js +200 -0
- package/dist/sleep-C_3mjcFi.js +25 -0
- package/dist/sort-DYZuiMaO.js +87 -0
- package/dist/stat-CXSSmsrA.js +38 -0
- package/dist/strings-BwqQy-zL.js +63 -0
- package/dist/tac-CuZSbu_c.js +32 -0
- package/dist/tail-DH7xR0rW.js +62 -0
- package/dist/tar-AnR03GXP.js +155 -0
- package/dist/tee-ByHsMExU.js +29 -0
- package/dist/touch-CcmnMpg5.js +26 -0
- package/dist/tr-D_cg13q8.js +92 -0
- package/dist/tree-Ck1ymlSv.js +64 -0
- package/dist/uname-07bQ7DTD.js +50 -0
- package/dist/uniq-BHkwpex3.js +76 -0
- package/dist/unzip-DVjk3GA4.js +91 -0
- package/dist/uptime-ujk4Nb77.js +17 -0
- package/dist/utils/archive.d.ts +2 -2
- package/dist/utils/archive.d.ts.map +1 -1
- package/dist/utils/glob.d.ts +2 -2
- package/dist/utils/glob.d.ts.map +1 -1
- package/dist/wc-CK9Flybx.js +98 -0
- package/dist/wget-Cww1uNE2.js +84 -0
- package/dist/{which-D3u0cwyh.js → which-CJwCjtVK.js} +25 -14
- package/dist/whoami-EHyrQ1q-.js +25 -0
- package/dist/xargs-I1ZWqhOp.js +40 -0
- package/dist/yes-XolnW6bp.js +11 -0
- package/dist/zip-BTmRwUYQ.js +40 -0
- package/package.json +16 -10
- package/dist/args-CG6b9cZt.js +0 -43
- package/dist/awk-CC_Qo0hQ.js +0 -123
- package/dist/base64-BBckAmkE.js +0 -72
- package/dist/basename-BIICW06y.js +0 -12
- package/dist/bc-BYiKVTNg.js +0 -200
- package/dist/cal-DPULSAhj.js +0 -56
- package/dist/cat-Jv35D4BV.js +0 -29
- package/dist/chmod-Bh-u8XOr.js +0 -56
- package/dist/chown-Dv7xfl2a.js +0 -28
- package/dist/cp-CB-sGTRH.js +0 -19
- package/dist/cut-B79kgCm4.js +0 -65
- package/dist/date-C8NB8v8G.js +0 -86
- package/dist/df-CeZb4WOr.js +0 -34
- package/dist/diff-D5Ej-JEe.js +0 -150
- package/dist/dig-BEJ8Ky96.js +0 -69
- package/dist/dirname-w2Y6csox.js +0 -13
- package/dist/du-UupzdKc_.js +0 -77
- package/dist/env-DXzvDKsN.js +0 -9
- package/dist/fastfetch-aPM9Z3ym.js +0 -310
- package/dist/file-DOl4Wjtc.js +0 -70
- package/dist/find-C0T-P7sl.js +0 -36
- package/dist/free-DAxE4b2U.js +0 -23
- package/dist/grep-Blwrv9k5.js +0 -147
- package/dist/gunzip-R7EtgP15.js +0 -47
- package/dist/gzip-BxF7M1np.js +0 -57
- package/dist/head-CJwcsX18.js +0 -53
- package/dist/hostname-BxU2S3nT.js +0 -8
- package/dist/index-BjKSFBDg.js +0 -8640
- package/dist/kernel/index.d.ts +0 -26
- package/dist/kernel/index.d.ts.map +0 -1
- package/dist/kernel/persistence/PersistenceManager.d.ts +0 -12
- package/dist/kernel/persistence/PersistenceManager.d.ts.map +0 -1
- package/dist/kernel/persistence/backends.d.ts +0 -22
- package/dist/kernel/persistence/backends.d.ts.map +0 -1
- package/dist/kernel/persistence/index.d.ts +0 -6
- package/dist/kernel/persistence/index.d.ts.map +0 -1
- package/dist/kernel/persistence/serializer.d.ts +0 -21
- package/dist/kernel/persistence/serializer.d.ts.map +0 -1
- package/dist/kernel/samples.d.ts +0 -3
- package/dist/kernel/samples.d.ts.map +0 -1
- package/dist/kernel/storage/BlobStore.d.ts +0 -31
- package/dist/kernel/storage/BlobStore.d.ts.map +0 -1
- package/dist/kernel/storage/ContentStore.d.ts +0 -52
- package/dist/kernel/storage/ContentStore.d.ts.map +0 -1
- package/dist/kernel/storage/index.d.ts +0 -7
- package/dist/kernel/storage/index.d.ts.map +0 -1
- package/dist/kernel/vfs/VFS.d.ts +0 -64
- package/dist/kernel/vfs/VFS.d.ts.map +0 -1
- package/dist/kernel/vfs/index.d.ts +0 -7
- package/dist/kernel/vfs/index.d.ts.map +0 -1
- package/dist/kernel/vfs/providers/DevProvider.d.ts +0 -11
- package/dist/kernel/vfs/providers/DevProvider.d.ts.map +0 -1
- package/dist/kernel/vfs/providers/NativeFsProvider.d.ts +0 -63
- package/dist/kernel/vfs/providers/NativeFsProvider.d.ts.map +0 -1
- package/dist/kernel/vfs/providers/ProcProvider.d.ts +0 -14
- package/dist/kernel/vfs/providers/ProcProvider.d.ts.map +0 -1
- package/dist/kernel/vfs/types.d.ts +0 -70
- package/dist/kernel/vfs/types.d.ts.map +0 -1
- package/dist/less-B0gFLJ_7.js +0 -230
- package/dist/ln-Bf3f3jVA.js +0 -11
- package/dist/ls-YnhMRefh.js +0 -106
- package/dist/mkdir-DY1P3Jxj.js +0 -27
- package/dist/mktemp-BRzo2c8y.js +0 -31
- package/dist/mv-bH08L-F_.js +0 -19
- package/dist/nano-CueO2oS0.js +0 -304
- package/dist/nl-D26SSOD4.js +0 -51
- package/dist/node-compat/buffer.d.ts +0 -44
- package/dist/node-compat/buffer.d.ts.map +0 -1
- package/dist/node-compat/child_process.d.ts +0 -10
- package/dist/node-compat/child_process.d.ts.map +0 -1
- package/dist/node-compat/console.d.ts +0 -21
- package/dist/node-compat/console.d.ts.map +0 -1
- package/dist/node-compat/crypto.d.ts +0 -17
- package/dist/node-compat/crypto.d.ts.map +0 -1
- package/dist/node-compat/events.d.ts +0 -19
- package/dist/node-compat/events.d.ts.map +0 -1
- package/dist/node-compat/fs.d.ts +0 -175
- package/dist/node-compat/fs.d.ts.map +0 -1
- package/dist/node-compat/http.d.ts +0 -87
- package/dist/node-compat/http.d.ts.map +0 -1
- package/dist/node-compat/index.d.ts +0 -19
- package/dist/node-compat/index.d.ts.map +0 -1
- package/dist/node-compat/os.d.ts +0 -39
- package/dist/node-compat/os.d.ts.map +0 -1
- package/dist/node-compat/path.d.ts +0 -58
- package/dist/node-compat/path.d.ts.map +0 -1
- package/dist/node-compat/process.d.ts +0 -62
- package/dist/node-compat/process.d.ts.map +0 -1
- package/dist/node-compat/stream.d.ts +0 -36
- package/dist/node-compat/stream.d.ts.map +0 -1
- package/dist/node-compat/string_decoder.d.ts +0 -11
- package/dist/node-compat/string_decoder.d.ts.map +0 -1
- package/dist/node-compat/timers.d.ts +0 -16
- package/dist/node-compat/timers.d.ts.map +0 -1
- package/dist/node-compat/url.d.ts +0 -53
- package/dist/node-compat/url.d.ts.map +0 -1
- package/dist/node-compat/util.d.ts +0 -27
- package/dist/node-compat/util.d.ts.map +0 -1
- package/dist/node-compat/zlib.d.ts +0 -66
- package/dist/node-compat/zlib.d.ts.map +0 -1
- package/dist/ping-DtVEwwda.js +0 -50
- package/dist/printf-Cc2o7KZx.js +0 -70
- package/dist/realpath-BH29Lem_.js +0 -24
- package/dist/rev-ySwmRf_K.js +0 -39
- package/dist/rm-D7iWUUE2.js +0 -37
- package/dist/rmdir-BLtdNjt1.js +0 -35
- package/dist/sed-DwBPYYFb.js +0 -95
- package/dist/seq-B01YKIbO.js +0 -37
- package/dist/sha256sum-DED6ePiU.js +0 -64
- package/dist/sl-Dv4iPBN6.js +0 -138
- package/dist/sleep-B4C3fZiR.js +0 -19
- package/dist/sort-OXqZY83v.js +0 -64
- package/dist/stat-BvwNpE5B.js +0 -29
- package/dist/strings-BesRwUt_.js +0 -42
- package/dist/tac-D4BMSdj9.js +0 -31
- package/dist/tail-xVmLkzJK.js +0 -52
- package/dist/tar-BHRJ0-4j.js +0 -120
- package/dist/tee-DxygINEJ.js +0 -17
- package/dist/touch-DCb9Qn5q.js +0 -23
- package/dist/tr-DsCiwSIu.js +0 -60
- package/dist/tree-4QpgsnA0.js +0 -46
- package/dist/uname-BCn8HlJD.js +0 -37
- package/dist/uniq-xmgE0zRj.js +0 -54
- package/dist/unzip-CDKcoB0B.js +0 -81
- package/dist/uptime-CgBJegqU.js +0 -8
- package/dist/wc-B-jNRfLa.js +0 -69
- package/dist/wget-CO-45JoL.js +0 -53
- package/dist/whoami-Y18wqme3.js +0 -25
- package/dist/xargs-DfbCRFFd.js +0 -35
- package/dist/yes-DXEyHHD2.js +0 -10
- package/dist/zip-Cu1DzbAu.js +0 -33
package/dist/awk-CC_Qo0hQ.js
DELETED
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import { r as E, i as N, c as S, V as $ } from "./index-BjKSFBDg.js";
|
|
2
|
-
function W(e) {
|
|
3
|
-
const o = [];
|
|
4
|
-
let t = e.trim();
|
|
5
|
-
for (; t.length > 0 && (t = t.trim(), t.length !== 0); ) {
|
|
6
|
-
let s = null, a = "";
|
|
7
|
-
if (t.startsWith("BEGIN"))
|
|
8
|
-
s = "BEGIN", t = t.slice(5).trim();
|
|
9
|
-
else if (t.startsWith("END"))
|
|
10
|
-
s = "END", t = t.slice(3).trim();
|
|
11
|
-
else if (t.startsWith("/")) {
|
|
12
|
-
const n = t.indexOf("/", 1);
|
|
13
|
-
if (n > 0) {
|
|
14
|
-
try {
|
|
15
|
-
s = new RegExp(t.slice(1, n));
|
|
16
|
-
} catch {
|
|
17
|
-
s = null;
|
|
18
|
-
}
|
|
19
|
-
t = t.slice(n + 1).trim();
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
if (t.startsWith("{")) {
|
|
23
|
-
let n = 0, l = 0;
|
|
24
|
-
for (; l < t.length; l++)
|
|
25
|
-
if (t[l] === "{") n++;
|
|
26
|
-
else if (t[l] === "}" && (n--, n === 0))
|
|
27
|
-
break;
|
|
28
|
-
a = t.slice(1, l).trim(), t = t.slice(l + 1).trim();
|
|
29
|
-
} else s === null && (a = t, t = "");
|
|
30
|
-
o.push({ pattern: s, action: a });
|
|
31
|
-
}
|
|
32
|
-
return o;
|
|
33
|
-
}
|
|
34
|
-
function m(e, o, t, s, a, n, l) {
|
|
35
|
-
const f = [], p = e.split(";").map((r) => r.trim()).filter(Boolean);
|
|
36
|
-
for (const r of p)
|
|
37
|
-
if (r === "print" || r === "print $0")
|
|
38
|
-
f.push(t);
|
|
39
|
-
else if (r.startsWith("print ")) {
|
|
40
|
-
const h = r.slice(6).trim().split(",").map((g) => g.trim()).map((g) => k(g, o, t, s, a, l));
|
|
41
|
-
f.push(h.join(" "));
|
|
42
|
-
}
|
|
43
|
-
return f.join(`
|
|
44
|
-
`);
|
|
45
|
-
}
|
|
46
|
-
function k(e, o, t, s, a, n) {
|
|
47
|
-
if (e = e.trim(), e.startsWith('"') && e.endsWith('"'))
|
|
48
|
-
return e.slice(1, -1).replace(/\\n/g, `
|
|
49
|
-
`).replace(/\\t/g, " ");
|
|
50
|
-
if (e.startsWith("$")) {
|
|
51
|
-
const l = e.slice(1);
|
|
52
|
-
if (l === "NF")
|
|
53
|
-
return o[a - 1] || "";
|
|
54
|
-
const f = parseInt(l, 10);
|
|
55
|
-
return f === 0 ? t : o[f - 1] || "";
|
|
56
|
-
}
|
|
57
|
-
return e === "NR" ? String(s) : e === "NF" ? String(a) : n.has(e) ? n.get(e) : e;
|
|
58
|
-
}
|
|
59
|
-
const B = async (e) => {
|
|
60
|
-
let o = /\s+/, t = " ", s = "";
|
|
61
|
-
const a = [];
|
|
62
|
-
for (let r = 0; r < e.args.length; r++) {
|
|
63
|
-
const i = e.args[r];
|
|
64
|
-
i === "-F" && r + 1 < e.args.length ? (t = e.args[++r], o = new RegExp(t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"))) : i.startsWith("-F") && i.length > 2 ? (t = i.slice(2), o = new RegExp(t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"))) : s ? a.push(i) : s = i;
|
|
65
|
-
}
|
|
66
|
-
if (!s)
|
|
67
|
-
return e.stderr.write(`awk: missing program
|
|
68
|
-
`), 1;
|
|
69
|
-
let n = "";
|
|
70
|
-
if (a.length === 0)
|
|
71
|
-
if (e.stdin)
|
|
72
|
-
n = await e.stdin.readAll();
|
|
73
|
-
else
|
|
74
|
-
return e.stderr.write(`awk: missing file operand
|
|
75
|
-
`), 1;
|
|
76
|
-
else
|
|
77
|
-
for (const r of a) {
|
|
78
|
-
const i = E(e.cwd, r);
|
|
79
|
-
try {
|
|
80
|
-
if (e.vfs.stat(i), N(S(i))) {
|
|
81
|
-
e.stderr.write(`awk: ${r}: binary file, skipping
|
|
82
|
-
`);
|
|
83
|
-
continue;
|
|
84
|
-
}
|
|
85
|
-
n += e.vfs.readFileString(i);
|
|
86
|
-
} catch (c) {
|
|
87
|
-
if (c instanceof $)
|
|
88
|
-
return e.stderr.write(`awk: ${r}: ${c.message}
|
|
89
|
-
`), 1;
|
|
90
|
-
throw c;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
const l = W(s), f = n.replace(/\n$/, "").split(`
|
|
94
|
-
`), p = /* @__PURE__ */ new Map();
|
|
95
|
-
for (const r of l)
|
|
96
|
-
if (r.pattern === "BEGIN") {
|
|
97
|
-
const i = m(r.action, [], "", 0, 0, t, p);
|
|
98
|
-
i && e.stdout.write(i + `
|
|
99
|
-
`);
|
|
100
|
-
}
|
|
101
|
-
for (let r = 0; r < f.length; r++) {
|
|
102
|
-
const i = f[r], c = i.split(o).filter((u) => u !== ""), h = r + 1, g = c.length;
|
|
103
|
-
for (const u of l) {
|
|
104
|
-
if (u.pattern === "BEGIN" || u.pattern === "END") continue;
|
|
105
|
-
let d = !0;
|
|
106
|
-
if (u.pattern instanceof RegExp && (d = u.pattern.test(i)), d) {
|
|
107
|
-
const w = m(u.action, c, i, h, g, t, p);
|
|
108
|
-
w && e.stdout.write(w + `
|
|
109
|
-
`);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
for (const r of l)
|
|
114
|
-
if (r.pattern === "END") {
|
|
115
|
-
const i = m(r.action, [], "", f.length, 0, t, p);
|
|
116
|
-
i && e.stdout.write(i + `
|
|
117
|
-
`);
|
|
118
|
-
}
|
|
119
|
-
return 0;
|
|
120
|
-
};
|
|
121
|
-
export {
|
|
122
|
-
B as default
|
|
123
|
-
};
|
package/dist/base64-BBckAmkE.js
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { r as l, V as f } from "./index-BjKSFBDg.js";
|
|
2
|
-
function g(e) {
|
|
3
|
-
let i = "";
|
|
4
|
-
for (let s = 0; s < e.length; s++)
|
|
5
|
-
i += String.fromCharCode(e[s]);
|
|
6
|
-
return btoa(i);
|
|
7
|
-
}
|
|
8
|
-
function u(e) {
|
|
9
|
-
try {
|
|
10
|
-
return atob(e.replace(/\s/g, ""));
|
|
11
|
-
} catch {
|
|
12
|
-
throw new Error("invalid input");
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
const p = async (e) => {
|
|
16
|
-
let i = !1, s = 76;
|
|
17
|
-
const a = [];
|
|
18
|
-
for (let r = 0; r < e.args.length; r++) {
|
|
19
|
-
const t = e.args[r];
|
|
20
|
-
t === "-d" || t === "--decode" ? i = !0 : t === "-w" && r + 1 < e.args.length || t === "--wrap" && r + 1 < e.args.length ? s = parseInt(e.args[++r], 10) : (!t.startsWith("-") || t === "-") && a.push(t);
|
|
21
|
-
}
|
|
22
|
-
let n;
|
|
23
|
-
if (a.length === 1 && a[0] === "-")
|
|
24
|
-
if (e.stdin)
|
|
25
|
-
n = await e.stdin.readAll();
|
|
26
|
-
else
|
|
27
|
-
return e.stderr.write(`base64: missing input
|
|
28
|
-
`), 1;
|
|
29
|
-
else {
|
|
30
|
-
if (a.length === 0)
|
|
31
|
-
return e.stderr.write(`Usage: base64 [-d] [-w COLS] [FILE]
|
|
32
|
-
`), e.stderr.write(`Encode or decode base64. Use '-' to read from stdin.
|
|
33
|
-
`), 1;
|
|
34
|
-
{
|
|
35
|
-
const r = l(e.cwd, a[0]);
|
|
36
|
-
try {
|
|
37
|
-
i ? n = e.vfs.readFileString(r) : n = e.vfs.readFile(r);
|
|
38
|
-
} catch (t) {
|
|
39
|
-
if (t instanceof f)
|
|
40
|
-
return e.stderr.write(`base64: ${a[0]}: ${t.message}
|
|
41
|
-
`), 1;
|
|
42
|
-
throw t;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
if (i)
|
|
47
|
-
try {
|
|
48
|
-
const r = typeof n == "string" ? n : new TextDecoder().decode(n);
|
|
49
|
-
e.stdout.write(u(r));
|
|
50
|
-
} catch {
|
|
51
|
-
return e.stderr.write(`base64: invalid input
|
|
52
|
-
`), 1;
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
let r;
|
|
56
|
-
typeof n == "string" ? r = new TextEncoder().encode(n) : r = n;
|
|
57
|
-
let t = g(r);
|
|
58
|
-
if (s > 0) {
|
|
59
|
-
const d = [];
|
|
60
|
-
for (let o = 0; o < t.length; o += s)
|
|
61
|
-
d.push(t.slice(o, o + s));
|
|
62
|
-
t = d.join(`
|
|
63
|
-
`);
|
|
64
|
-
}
|
|
65
|
-
e.stdout.write(t + `
|
|
66
|
-
`);
|
|
67
|
-
}
|
|
68
|
-
return 0;
|
|
69
|
-
};
|
|
70
|
-
export {
|
|
71
|
-
p as default
|
|
72
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { b as a } from "./index-BjKSFBDg.js";
|
|
2
|
-
const t = async (s) => {
|
|
3
|
-
if (s.args.length === 0)
|
|
4
|
-
return s.stderr.write(`basename: missing operand
|
|
5
|
-
`), 1;
|
|
6
|
-
const n = s.args[0], r = s.args[1];
|
|
7
|
-
return s.stdout.write(a(n, r) + `
|
|
8
|
-
`), 0;
|
|
9
|
-
};
|
|
10
|
-
export {
|
|
11
|
-
t as default
|
|
12
|
-
};
|
package/dist/bc-BYiKVTNg.js
DELETED
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
var c = Object.defineProperty;
|
|
2
|
-
var p = (s, e, t) => e in s ? c(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
|
|
3
|
-
var h = (s, e, t) => p(s, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
function u(s) {
|
|
5
|
-
const e = [];
|
|
6
|
-
let t = 0;
|
|
7
|
-
for (; t < s.length; ) {
|
|
8
|
-
const r = s[t];
|
|
9
|
-
if (r === " " || r === " ") {
|
|
10
|
-
t++;
|
|
11
|
-
continue;
|
|
12
|
-
}
|
|
13
|
-
if (r === `
|
|
14
|
-
`) {
|
|
15
|
-
e.push({ type: "newline", value: `
|
|
16
|
-
` }), t++;
|
|
17
|
-
continue;
|
|
18
|
-
}
|
|
19
|
-
if (r >= "0" && r <= "9" || r === ".") {
|
|
20
|
-
let n = "";
|
|
21
|
-
for (; t < s.length && (s[t] >= "0" && s[t] <= "9" || s[t] === "."); )
|
|
22
|
-
n += s[t++];
|
|
23
|
-
e.push({ type: "number", value: n });
|
|
24
|
-
continue;
|
|
25
|
-
}
|
|
26
|
-
if (r >= "a" && r <= "z" || r >= "A" && r <= "Z" || r === "_") {
|
|
27
|
-
let n = "";
|
|
28
|
-
for (; t < s.length && (s[t] >= "a" && s[t] <= "z" || s[t] >= "A" && s[t] <= "Z" || s[t] >= "0" && s[t] <= "9" || s[t] === "_"); )
|
|
29
|
-
n += s[t++];
|
|
30
|
-
e.push({ type: "ident", value: n });
|
|
31
|
-
continue;
|
|
32
|
-
}
|
|
33
|
-
if ("+-*/%^()=".includes(r)) {
|
|
34
|
-
e.push({ type: r, value: r }), t++;
|
|
35
|
-
continue;
|
|
36
|
-
}
|
|
37
|
-
t++;
|
|
38
|
-
}
|
|
39
|
-
return e.push({ type: "eof", value: "" }), e;
|
|
40
|
-
}
|
|
41
|
-
class f {
|
|
42
|
-
constructor(e, t, r) {
|
|
43
|
-
h(this, "tokens");
|
|
44
|
-
h(this, "pos", 0);
|
|
45
|
-
h(this, "vars", {});
|
|
46
|
-
h(this, "scale", 0);
|
|
47
|
-
this.tokens = e, this.vars = t, this.scale = r;
|
|
48
|
-
}
|
|
49
|
-
getScale() {
|
|
50
|
-
return this.scale;
|
|
51
|
-
}
|
|
52
|
-
peek() {
|
|
53
|
-
return this.tokens[this.pos] || { type: "eof", value: "" };
|
|
54
|
-
}
|
|
55
|
-
advance() {
|
|
56
|
-
return this.tokens[this.pos++] || { type: "eof", value: "" };
|
|
57
|
-
}
|
|
58
|
-
expect(e) {
|
|
59
|
-
const t = this.advance();
|
|
60
|
-
if (t.type !== e)
|
|
61
|
-
throw new Error(`expected ${e}, got ${t.type}`);
|
|
62
|
-
return t;
|
|
63
|
-
}
|
|
64
|
-
// expression = assignment
|
|
65
|
-
parseExpression() {
|
|
66
|
-
return this.parseAssignment();
|
|
67
|
-
}
|
|
68
|
-
// assignment = ident '=' assignment | additive
|
|
69
|
-
parseAssignment() {
|
|
70
|
-
if (this.peek().type === "ident" && this.pos + 1 < this.tokens.length && this.tokens[this.pos + 1].type === "=") {
|
|
71
|
-
const e = this.advance().value;
|
|
72
|
-
this.advance();
|
|
73
|
-
const t = this.parseAssignment();
|
|
74
|
-
return e === "scale" ? this.scale = Math.floor(t) : this.vars[e] = t, t;
|
|
75
|
-
}
|
|
76
|
-
return this.parseAdditive();
|
|
77
|
-
}
|
|
78
|
-
// additive = multiplicative (('+' | '-') multiplicative)*
|
|
79
|
-
parseAdditive() {
|
|
80
|
-
let e = this.parseMultiplicative();
|
|
81
|
-
for (; this.peek().type === "+" || this.peek().type === "-"; ) {
|
|
82
|
-
const t = this.advance().type, r = this.parseMultiplicative();
|
|
83
|
-
e = t === "+" ? e + r : e - r;
|
|
84
|
-
}
|
|
85
|
-
return e;
|
|
86
|
-
}
|
|
87
|
-
// multiplicative = power (('*' | '/' | '%') power)*
|
|
88
|
-
parseMultiplicative() {
|
|
89
|
-
let e = this.parsePower();
|
|
90
|
-
for (; this.peek().type === "*" || this.peek().type === "/" || this.peek().type === "%"; ) {
|
|
91
|
-
const t = this.advance().type, r = this.parsePower();
|
|
92
|
-
if (t === "*") e = e * r;
|
|
93
|
-
else if (t === "/") {
|
|
94
|
-
if (r === 0) throw new Error("divide by zero");
|
|
95
|
-
e = e / r;
|
|
96
|
-
} else {
|
|
97
|
-
if (r === 0) throw new Error("divide by zero");
|
|
98
|
-
e = e % r;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
return e;
|
|
102
|
-
}
|
|
103
|
-
// power = unary ('^' power)? (right-associative)
|
|
104
|
-
parsePower() {
|
|
105
|
-
const e = this.parseUnary();
|
|
106
|
-
if (this.peek().type === "^") {
|
|
107
|
-
this.advance();
|
|
108
|
-
const t = this.parsePower();
|
|
109
|
-
return Math.pow(e, t);
|
|
110
|
-
}
|
|
111
|
-
return e;
|
|
112
|
-
}
|
|
113
|
-
// unary = '-' unary | primary
|
|
114
|
-
parseUnary() {
|
|
115
|
-
return this.peek().type === "-" ? (this.advance(), -this.parseUnary()) : this.parsePrimary();
|
|
116
|
-
}
|
|
117
|
-
// primary = number | ident | ident '(' expr ')' | '(' expr ')'
|
|
118
|
-
parsePrimary() {
|
|
119
|
-
const e = this.peek();
|
|
120
|
-
if (e.type === "number")
|
|
121
|
-
return this.advance(), parseFloat(e.value);
|
|
122
|
-
if (e.type === "ident") {
|
|
123
|
-
if (this.advance(), this.peek().type === "(") {
|
|
124
|
-
this.advance();
|
|
125
|
-
const t = this.parseExpression();
|
|
126
|
-
if (this.expect(")"), e.value === "sqrt") {
|
|
127
|
-
if (t < 0) throw new Error("square root of negative number");
|
|
128
|
-
return Math.sqrt(t);
|
|
129
|
-
}
|
|
130
|
-
if (e.value === "length") return String(Math.floor(t)).length;
|
|
131
|
-
throw new Error(`unknown function: ${e.value}`);
|
|
132
|
-
}
|
|
133
|
-
return e.value === "scale" ? this.scale : this.vars[e.value] ?? 0;
|
|
134
|
-
}
|
|
135
|
-
if (e.type === "(") {
|
|
136
|
-
this.advance();
|
|
137
|
-
const t = this.parseExpression();
|
|
138
|
-
return this.expect(")"), t;
|
|
139
|
-
}
|
|
140
|
-
throw new Error(`unexpected token: ${e.type}`);
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
function d(s, e) {
|
|
144
|
-
if (e === 0) {
|
|
145
|
-
const t = s < 0 ? Math.ceil(s) : Math.floor(s);
|
|
146
|
-
return String(t);
|
|
147
|
-
}
|
|
148
|
-
return s.toFixed(e);
|
|
149
|
-
}
|
|
150
|
-
const y = async (s) => {
|
|
151
|
-
const e = {};
|
|
152
|
-
let t = 0;
|
|
153
|
-
const r = (n) => {
|
|
154
|
-
const i = n.trim();
|
|
155
|
-
if (!i || i.startsWith("#")) return null;
|
|
156
|
-
if (i === "quit") return "quit";
|
|
157
|
-
try {
|
|
158
|
-
const a = u(i), o = new f(a, e, t), l = o.parseExpression();
|
|
159
|
-
return t = o.getScale(), d(l, t);
|
|
160
|
-
} catch (a) {
|
|
161
|
-
return `error: ${a.message}`;
|
|
162
|
-
}
|
|
163
|
-
};
|
|
164
|
-
if (s.args.length >= 2 && s.args[0] === "-e") {
|
|
165
|
-
const n = s.args.slice(1).join(" "), i = r(n);
|
|
166
|
-
return i !== null && i !== "quit" && s.stdout.write(i + `
|
|
167
|
-
`), 0;
|
|
168
|
-
}
|
|
169
|
-
if (s.args.length > 0 && s.args[0] !== "-e") {
|
|
170
|
-
const n = s.args[0];
|
|
171
|
-
try {
|
|
172
|
-
const i = s.vfs.readFileString(n);
|
|
173
|
-
for (const a of i.split(`
|
|
174
|
-
`)) {
|
|
175
|
-
const o = r(a);
|
|
176
|
-
if (o === "quit") return 0;
|
|
177
|
-
o !== null && s.stdout.write(o + `
|
|
178
|
-
`);
|
|
179
|
-
}
|
|
180
|
-
return 0;
|
|
181
|
-
} catch {
|
|
182
|
-
return s.stderr.write(`bc: ${n}: No such file
|
|
183
|
-
`), 1;
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
if (s.stdin) {
|
|
187
|
-
const n = await s.stdin.readAll();
|
|
188
|
-
for (const i of n.split(`
|
|
189
|
-
`)) {
|
|
190
|
-
const a = r(i);
|
|
191
|
-
if (a === "quit") return 0;
|
|
192
|
-
a !== null && s.stdout.write(a + `
|
|
193
|
-
`);
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
return 0;
|
|
197
|
-
};
|
|
198
|
-
export {
|
|
199
|
-
y as default
|
|
200
|
-
};
|
package/dist/cal-DPULSAhj.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
const y = [
|
|
2
|
-
"January",
|
|
3
|
-
"February",
|
|
4
|
-
"March",
|
|
5
|
-
"April",
|
|
6
|
-
"May",
|
|
7
|
-
"June",
|
|
8
|
-
"July",
|
|
9
|
-
"August",
|
|
10
|
-
"September",
|
|
11
|
-
"October",
|
|
12
|
-
"November",
|
|
13
|
-
"December"
|
|
14
|
-
];
|
|
15
|
-
function u(e, r, a) {
|
|
16
|
-
const t = /* @__PURE__ */ new Date(), n = a && t.getFullYear() === e && t.getMonth() === r, s = t.getDate(), h = `${y[r]} ${e}`, p = "Su Mo Tu We Th Fr Sa", l = [];
|
|
17
|
-
l.push(h.padStart(Math.floor((20 + h.length) / 2)).padEnd(20)), l.push(p);
|
|
18
|
-
const c = new Date(e, r, 1).getDay(), d = new Date(e, r + 1, 0).getDate();
|
|
19
|
-
let o = " ".repeat(c), g = c;
|
|
20
|
-
for (let i = 1; i <= d; i++) {
|
|
21
|
-
const f = String(i).padStart(2, " ");
|
|
22
|
-
n && i === s ? o += `\x1B[7m${f}\x1B[0m` : o += f, g++, g === 7 && i < d ? (l.push(o), o = "", g = 0) : i < d && (o += " ");
|
|
23
|
-
}
|
|
24
|
-
return o.length > 0 && l.push(o), l.join(`
|
|
25
|
-
`) + `
|
|
26
|
-
`;
|
|
27
|
-
}
|
|
28
|
-
const M = async (e) => {
|
|
29
|
-
const r = /* @__PURE__ */ new Date(), a = e.args.filter((t) => !t.startsWith("-"));
|
|
30
|
-
if (a.length === 0)
|
|
31
|
-
e.stdout.write(u(r.getFullYear(), r.getMonth(), !0));
|
|
32
|
-
else if (a.length === 1) {
|
|
33
|
-
const t = parseInt(a[0], 10);
|
|
34
|
-
if (isNaN(t) || t < 1)
|
|
35
|
-
return e.stderr.write(`cal: invalid argument: ${a[0]}
|
|
36
|
-
`), 1;
|
|
37
|
-
if (t > 12) {
|
|
38
|
-
const n = t;
|
|
39
|
-
for (let s = 0; s < 12; s++)
|
|
40
|
-
e.stdout.write(u(n, s, r.getFullYear() === n)), s < 11 && e.stdout.write(`
|
|
41
|
-
`);
|
|
42
|
-
} else
|
|
43
|
-
e.stdout.write(u(r.getFullYear(), t - 1, !0));
|
|
44
|
-
} else {
|
|
45
|
-
const t = parseInt(a[0], 10), n = parseInt(a[1], 10);
|
|
46
|
-
if (isNaN(t) || t < 1 || t > 12 || isNaN(n) || n < 1)
|
|
47
|
-
return e.stderr.write(`cal: invalid arguments
|
|
48
|
-
`), 1;
|
|
49
|
-
const s = r.getFullYear() === n && r.getMonth() === t - 1;
|
|
50
|
-
e.stdout.write(u(n, t - 1, s));
|
|
51
|
-
}
|
|
52
|
-
return 0;
|
|
53
|
-
};
|
|
54
|
-
export {
|
|
55
|
-
M as default
|
|
56
|
-
};
|
package/dist/cat-Jv35D4BV.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { r as o, V as a } from "./index-BjKSFBDg.js";
|
|
2
|
-
const d = async (r) => {
|
|
3
|
-
if (r.args.length === 0) {
|
|
4
|
-
if (r.stdin) {
|
|
5
|
-
const e = await r.stdin.readAll();
|
|
6
|
-
return r.stdout.write(e), 0;
|
|
7
|
-
}
|
|
8
|
-
return r.stderr.write(`cat: missing operand
|
|
9
|
-
`), 1;
|
|
10
|
-
}
|
|
11
|
-
let s = 0;
|
|
12
|
-
for (const e of r.args) {
|
|
13
|
-
const n = o(r.cwd, e);
|
|
14
|
-
try {
|
|
15
|
-
const t = r.vfs.readFileString(n);
|
|
16
|
-
r.stdout.write(t);
|
|
17
|
-
} catch (t) {
|
|
18
|
-
if (t instanceof a)
|
|
19
|
-
r.stderr.write(`cat: ${e}: ${t.message}
|
|
20
|
-
`), s = 1;
|
|
21
|
-
else
|
|
22
|
-
throw t;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
return s;
|
|
26
|
-
};
|
|
27
|
-
export {
|
|
28
|
-
d as default
|
|
29
|
-
};
|
package/dist/chmod-Bh-u8XOr.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { r as u, V as l } from "./index-BjKSFBDg.js";
|
|
2
|
-
function h(t, d) {
|
|
3
|
-
if (/^[0-7]+$/.test(t))
|
|
4
|
-
return parseInt(t, 8);
|
|
5
|
-
let s = d;
|
|
6
|
-
const i = t.match(/^([ugoa]*)([+\-=])([rwx]+)$/);
|
|
7
|
-
if (!i) return s;
|
|
8
|
-
const n = i[1] || "a", c = i[2], e = i[3];
|
|
9
|
-
let o = 0;
|
|
10
|
-
e.includes("r") && (o |= 4), e.includes("w") && (o |= 2), e.includes("x") && (o |= 1);
|
|
11
|
-
const r = [];
|
|
12
|
-
(n.includes("u") || n.includes("a")) && r.push(6), (n.includes("g") || n.includes("a")) && r.push(3), (n.includes("o") || n.includes("a")) && r.push(0);
|
|
13
|
-
for (const f of r) {
|
|
14
|
-
const a = o << f;
|
|
15
|
-
c === "+" ? s |= a : c === "-" ? s &= ~a : c === "=" && (s &= ~(7 << f), s |= a);
|
|
16
|
-
}
|
|
17
|
-
return s;
|
|
18
|
-
}
|
|
19
|
-
const p = async (t) => {
|
|
20
|
-
let d = !1, s = "";
|
|
21
|
-
const i = [];
|
|
22
|
-
for (const e of t.args)
|
|
23
|
-
e === "-R" || e === "-r" ? d = !0 : s ? i.push(e) : s = e;
|
|
24
|
-
if (!s || i.length === 0)
|
|
25
|
-
return t.stderr.write(`chmod: missing operand
|
|
26
|
-
`), 1;
|
|
27
|
-
function n(e) {
|
|
28
|
-
const o = t.vfs.stat(e);
|
|
29
|
-
if (h(s, o.mode), o.type === "directory" && d)
|
|
30
|
-
try {
|
|
31
|
-
const r = t.vfs.readdir(e);
|
|
32
|
-
for (const f of r) {
|
|
33
|
-
const a = e === "/" ? "/" + f.name : e + "/" + f.name;
|
|
34
|
-
n(a);
|
|
35
|
-
}
|
|
36
|
-
} catch {
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
let c = 0;
|
|
40
|
-
for (const e of i) {
|
|
41
|
-
const o = u(t.cwd, e);
|
|
42
|
-
try {
|
|
43
|
-
n(o);
|
|
44
|
-
} catch (r) {
|
|
45
|
-
if (r instanceof l)
|
|
46
|
-
t.stderr.write(`chmod: ${e}: ${r.message}
|
|
47
|
-
`), c = 1;
|
|
48
|
-
else
|
|
49
|
-
throw r;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
return c;
|
|
53
|
-
};
|
|
54
|
-
export {
|
|
55
|
-
p as default
|
|
56
|
-
};
|
package/dist/chown-Dv7xfl2a.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { p as i } from "./args-CG6b9cZt.js";
|
|
2
|
-
import { r as c, V as f } from "./index-BjKSFBDg.js";
|
|
3
|
-
const l = {
|
|
4
|
-
recursive: { type: "boolean", short: "R" }
|
|
5
|
-
}, d = async (s) => {
|
|
6
|
-
const { positional: r } = i(s.args, l);
|
|
7
|
-
if (r.length < 2)
|
|
8
|
-
return s.stderr.write(`chown: missing operand
|
|
9
|
-
`), 1;
|
|
10
|
-
const n = r.slice(1);
|
|
11
|
-
let o = 0;
|
|
12
|
-
for (const t of n) {
|
|
13
|
-
const a = c(s.cwd, t);
|
|
14
|
-
try {
|
|
15
|
-
s.vfs.stat(a);
|
|
16
|
-
} catch (e) {
|
|
17
|
-
if (e instanceof f)
|
|
18
|
-
s.stderr.write(`chown: ${t}: ${e.message}
|
|
19
|
-
`), o = 1;
|
|
20
|
-
else
|
|
21
|
-
throw e;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
return o;
|
|
25
|
-
};
|
|
26
|
-
export {
|
|
27
|
-
d as default
|
|
28
|
-
};
|
package/dist/cp-CB-sGTRH.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { r as t, b as n, V as o } from "./index-BjKSFBDg.js";
|
|
2
|
-
const f = async (s) => {
|
|
3
|
-
if (s.args.length < 2)
|
|
4
|
-
return s.stderr.write(`cp: missing operand
|
|
5
|
-
`), 1;
|
|
6
|
-
const a = t(s.cwd, s.args[0]);
|
|
7
|
-
let r = t(s.cwd, s.args[1]);
|
|
8
|
-
try {
|
|
9
|
-
return s.vfs.exists(r) && s.vfs.stat(r).type === "directory" && (r = t(r, n(a))), s.vfs.copyFile(a, r), 0;
|
|
10
|
-
} catch (e) {
|
|
11
|
-
if (e instanceof o)
|
|
12
|
-
return s.stderr.write(`cp: ${e.message}
|
|
13
|
-
`), 1;
|
|
14
|
-
throw e;
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
export {
|
|
18
|
-
f as default
|
|
19
|
-
};
|
package/dist/cut-B79kgCm4.js
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { r as d, i as c, c as u, V as g } from "./index-BjKSFBDg.js";
|
|
2
|
-
function h(e) {
|
|
3
|
-
const i = [];
|
|
4
|
-
for (const r of e.split(",")) {
|
|
5
|
-
const n = r.split("-");
|
|
6
|
-
if (n.length === 2) {
|
|
7
|
-
const a = parseInt(n[0], 10), o = parseInt(n[1], 10);
|
|
8
|
-
if (!isNaN(a) && !isNaN(o))
|
|
9
|
-
for (let l = a; l <= o; l++) i.push(l);
|
|
10
|
-
} else {
|
|
11
|
-
const a = parseInt(r, 10);
|
|
12
|
-
isNaN(a) || i.push(a);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
return i;
|
|
16
|
-
}
|
|
17
|
-
const w = async (e) => {
|
|
18
|
-
let i = " ", r = "";
|
|
19
|
-
const n = [];
|
|
20
|
-
for (let s = 0; s < e.args.length; s++) {
|
|
21
|
-
const t = e.args[s];
|
|
22
|
-
t === "-d" && s + 1 < e.args.length ? i = e.args[++s] : t === "-f" && s + 1 < e.args.length ? r = e.args[++s] : t.startsWith("-d") && t.length > 2 ? i = t.slice(2) : t.startsWith("-f") && t.length > 2 ? r = t.slice(2) : n.push(t);
|
|
23
|
-
}
|
|
24
|
-
if (!r)
|
|
25
|
-
return e.stderr.write(`cut: you must specify a list of fields
|
|
26
|
-
`), 1;
|
|
27
|
-
const a = h(r);
|
|
28
|
-
function o(s) {
|
|
29
|
-
const t = s.split(i);
|
|
30
|
-
return a.map((f) => t[f - 1] || "").join(i);
|
|
31
|
-
}
|
|
32
|
-
let l = "";
|
|
33
|
-
if (n.length === 0)
|
|
34
|
-
if (e.stdin)
|
|
35
|
-
l = await e.stdin.readAll();
|
|
36
|
-
else
|
|
37
|
-
return e.stderr.write(`cut: missing file operand
|
|
38
|
-
`), 1;
|
|
39
|
-
else
|
|
40
|
-
for (const s of n) {
|
|
41
|
-
const t = d(e.cwd, s);
|
|
42
|
-
try {
|
|
43
|
-
if (e.vfs.stat(t), c(u(t))) {
|
|
44
|
-
e.stderr.write(`cut: ${s}: binary file, skipping
|
|
45
|
-
`);
|
|
46
|
-
continue;
|
|
47
|
-
}
|
|
48
|
-
l += e.vfs.readFileString(t);
|
|
49
|
-
} catch (f) {
|
|
50
|
-
if (f instanceof g)
|
|
51
|
-
return e.stderr.write(`cut: ${s}: ${f.message}
|
|
52
|
-
`), 1;
|
|
53
|
-
throw f;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
const p = l.replace(/\n$/, "").split(`
|
|
57
|
-
`);
|
|
58
|
-
for (const s of p)
|
|
59
|
-
e.stdout.write(o(s) + `
|
|
60
|
-
`);
|
|
61
|
-
return 0;
|
|
62
|
-
};
|
|
63
|
-
export {
|
|
64
|
-
w as default
|
|
65
|
-
};
|