@lifo-sh/core 0.2.0 → 0.4.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/dist/awk-CI8X5kVy.js +123 -0
- package/dist/{basename-C2v8jn7p.js → basename-D8VowKZK.js} +1 -1
- package/dist/{cat-B2exoWlk.js → cat-BPj_LHfi.js} +1 -1
- package/dist/{chmod-CQS63aP7.js → chmod-pNQSdBnq.js} +1 -1
- package/dist/{chown-rgGwZwu9.js → chown-BzpeyVqg.js} +1 -1
- package/dist/commands/system/lifo.d.ts +11 -0
- package/dist/commands/system/lifo.d.ts.map +1 -0
- package/dist/commands/system/node.d.ts.map +1 -1
- package/dist/commands/system/npm.d.ts +5 -0
- package/dist/commands/system/npm.d.ts.map +1 -0
- package/dist/commands/text/awk.d.ts.map +1 -1
- package/dist/commands/text/cut.d.ts.map +1 -1
- package/dist/commands/text/diff.d.ts.map +1 -1
- package/dist/commands/text/grep.d.ts.map +1 -1
- package/dist/commands/text/head.d.ts.map +1 -1
- package/dist/commands/text/nl.d.ts.map +1 -1
- package/dist/commands/text/rev.d.ts.map +1 -1
- package/dist/commands/text/sed.d.ts.map +1 -1
- package/dist/commands/text/sort.d.ts.map +1 -1
- package/dist/commands/text/tail.d.ts.map +1 -1
- package/dist/commands/text/uniq.d.ts.map +1 -1
- package/dist/commands/text/wc.d.ts.map +1 -1
- package/dist/{cp-C8mNek36.js → cp-_rhci8W9.js} +1 -1
- package/dist/cut-Q5nQyrUo.js +65 -0
- package/dist/diff-Dvc96Xgm.js +150 -0
- package/dist/{dirname-BY_Gu5i2.js → dirname-B9Rm-O9I.js} +1 -1
- package/dist/{du-D25egSeK.js → du-Cv4zAsqm.js} +1 -1
- package/dist/{file-BPs1dqg5.js → file-Cxgmm1Vo.js} +1 -1
- package/dist/{find-CRUAXbhO.js → find-BJNOna6S.js} +1 -1
- package/dist/{grep-B9pTCSNY.js → grep-vdjjGK6g.js} +33 -26
- package/dist/gunzip-AmY9PUj2.js +47 -0
- package/dist/{gzip-DgE-9PzE.js → gzip-C_08tX3p.js} +4 -5
- package/dist/head-DGXxKqPE.js +53 -0
- package/dist/index-CvsPTm3-.js +8450 -0
- package/dist/index.d.ts +17 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +69 -44
- package/dist/kernel/index.d.ts +2 -1
- package/dist/kernel/index.d.ts.map +1 -1
- package/dist/kernel/persistence/PersistenceManager.d.ts +3 -1
- package/dist/kernel/persistence/PersistenceManager.d.ts.map +1 -1
- package/dist/kernel/persistence/backends.d.ts +22 -0
- package/dist/kernel/persistence/backends.d.ts.map +1 -0
- package/dist/kernel/persistence/index.d.ts +6 -0
- package/dist/kernel/persistence/index.d.ts.map +1 -0
- package/dist/kernel/persistence/serializer.d.ts +8 -0
- package/dist/kernel/persistence/serializer.d.ts.map +1 -1
- package/dist/kernel/storage/BlobStore.d.ts +31 -0
- package/dist/kernel/storage/BlobStore.d.ts.map +1 -0
- package/dist/kernel/storage/ContentStore.d.ts +52 -0
- package/dist/kernel/storage/ContentStore.d.ts.map +1 -0
- package/dist/kernel/storage/index.d.ts +7 -0
- package/dist/kernel/storage/index.d.ts.map +1 -0
- package/dist/kernel/vfs/VFS.d.ts +31 -3
- package/dist/kernel/vfs/VFS.d.ts.map +1 -1
- package/dist/kernel/vfs/index.d.ts +4 -1
- package/dist/kernel/vfs/index.d.ts.map +1 -1
- package/dist/kernel/vfs/providers/NativeFsProvider.d.ts +63 -0
- package/dist/kernel/vfs/providers/NativeFsProvider.d.ts.map +1 -0
- package/dist/kernel/vfs/types.d.ts +27 -0
- package/dist/kernel/vfs/types.d.ts.map +1 -1
- package/dist/{ls-BiT10kLm.js → ls-BOMe19Ls.js} +1 -1
- package/dist/{mkdir-DgzJ2JLj.js → mkdir-DE5ZBdl1.js} +1 -1
- package/dist/{mktemp-Sh5DWxvc.js → mktemp-De1K5WCb.js} +1 -1
- package/dist/{mv-Kp6DjQ8n.js → mv-Cw8pg9wR.js} +1 -1
- package/dist/{nl-DBLFdpfC.js → nl-C-osPl2N.js} +13 -10
- package/dist/node-compat/buffer.d.ts +29 -2
- package/dist/node-compat/buffer.d.ts.map +1 -1
- package/dist/node-compat/fs.d.ts +62 -0
- package/dist/node-compat/fs.d.ts.map +1 -1
- package/dist/node-compat/index.d.ts.map +1 -1
- package/dist/node-compat/string_decoder.d.ts +11 -0
- package/dist/node-compat/string_decoder.d.ts.map +1 -0
- package/dist/node-compat/zlib.d.ts +66 -0
- package/dist/node-compat/zlib.d.ts.map +1 -0
- package/dist/pkg/lifo-dev.d.ts +32 -0
- package/dist/pkg/lifo-dev.d.ts.map +1 -0
- package/dist/pkg/lifo-runtime.d.ts +35 -0
- package/dist/pkg/lifo-runtime.d.ts.map +1 -0
- package/dist/{realpath-BOeYN6nD.js → realpath-BSWdZLjf.js} +1 -1
- package/dist/rev-3C5MtCkc.js +39 -0
- package/dist/{rm-DA2w3xTR.js → rm-CR560cHz.js} +1 -1
- package/dist/{rmdir-BiGbNDOT.js → rmdir-BO4Jz3r5.js} +3 -3
- package/dist/sandbox/Sandbox.d.ts +31 -0
- package/dist/sandbox/Sandbox.d.ts.map +1 -1
- package/dist/sandbox/SandboxFs.d.ts +4 -0
- package/dist/sandbox/SandboxFs.d.ts.map +1 -1
- package/dist/sandbox/types.d.ts +19 -0
- package/dist/sandbox/types.d.ts.map +1 -1
- package/dist/sed-DCUgJWcA.js +95 -0
- package/dist/{sort-CSzSGTdB.js → sort-or-F_iEY.js} +19 -14
- package/dist/{stat-D0i1gTKB.js → stat-MGHvbiS7.js} +1 -1
- package/dist/tail-DheqHGe2.js +52 -0
- package/dist/{tar-DkyzTzmT.js → tar-DhLtWtBV.js} +15 -16
- package/dist/{tee-RqoZ3qG-.js → tee-D47GOzfR.js} +1 -1
- package/dist/{touch-k2NomRzL.js → touch-D7Xd2vNM.js} +1 -1
- package/dist/{tree-B_j2_PsZ.js → tree-CRpLFDhe.js} +1 -1
- package/dist/uniq-DwHCe--v.js +54 -0
- package/dist/{unzip-FwYCTDEZ.js → unzip-DPEg74Aq.js} +18 -19
- package/dist/utils/mime.d.ts +4 -0
- package/dist/utils/mime.d.ts.map +1 -0
- package/dist/wc-BUIoLfSN.js +69 -0
- package/dist/{wget-2NAABIHc.js → wget-BwmpusXQ.js} +1 -1
- package/dist/{zip--0ncHv0q.js → zip-B4jRyQ7B.js} +11 -12
- package/package.json +10 -9
- package/dist/archive-nRHWNwjH.js +0 -192
- package/dist/awk-CchAsBzt.js +0 -118
- package/dist/cut-BZez9bS1.js +0 -60
- package/dist/diff-tWPvmikU.js +0 -129
- package/dist/gunzip-BYlJhPf7.js +0 -48
- package/dist/head-DzP_T5Wx.js +0 -48
- package/dist/index-DccAPaZF.js +0 -6010
- package/dist/rev-CWRUIXWp.js +0 -34
- package/dist/sed-ClWZ06zX.js +0 -90
- package/dist/tail-tcIJLQnB.js +0 -47
- package/dist/uniq-hzJnHQOm.js +0 -51
- package/dist/wc-Jp7nOops.js +0 -60
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { r as u, j as d, V as l } from "./index-CvsPTm3-.js";
|
|
2
|
+
const g = async (e) => {
|
|
3
|
+
let o = !1;
|
|
4
|
+
const t = [];
|
|
5
|
+
for (const s of e.args)
|
|
6
|
+
switch (s) {
|
|
7
|
+
case "-k":
|
|
8
|
+
case "--keep":
|
|
9
|
+
o = !0;
|
|
10
|
+
break;
|
|
11
|
+
case "--help":
|
|
12
|
+
return e.stdout.write(`Usage: gunzip [-k] file.gz
|
|
13
|
+
`), e.stdout.write(` -k, --keep keep original file
|
|
14
|
+
`), 0;
|
|
15
|
+
default:
|
|
16
|
+
if (s.startsWith("-"))
|
|
17
|
+
return e.stderr.write(`gunzip: unknown option: ${s}
|
|
18
|
+
`), 1;
|
|
19
|
+
t.push(s);
|
|
20
|
+
}
|
|
21
|
+
if (t.length === 0)
|
|
22
|
+
return e.stderr.write(`gunzip: missing file operand
|
|
23
|
+
`), 1;
|
|
24
|
+
let n = 0;
|
|
25
|
+
for (const s of t) {
|
|
26
|
+
const i = u(e.cwd, s);
|
|
27
|
+
try {
|
|
28
|
+
if (!i.endsWith(".gz")) {
|
|
29
|
+
e.stderr.write(`gunzip: ${s}: unknown suffix -- ignored
|
|
30
|
+
`), n = 1;
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
const r = e.vfs.readFile(i), a = await d(r), f = i.slice(0, -3);
|
|
34
|
+
e.vfs.writeFile(f, a), o || e.vfs.unlink(i);
|
|
35
|
+
} catch (r) {
|
|
36
|
+
if (r instanceof l)
|
|
37
|
+
e.stderr.write(`gunzip: ${s}: ${r.message}
|
|
38
|
+
`), n = 1;
|
|
39
|
+
else
|
|
40
|
+
throw r;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return n;
|
|
44
|
+
};
|
|
45
|
+
export {
|
|
46
|
+
g as default
|
|
47
|
+
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { r as p,
|
|
2
|
-
import { d as u, b as c } from "./archive-nRHWNwjH.js";
|
|
1
|
+
import { r as p, j as l, h as u, V as c } from "./index-CvsPTm3-.js";
|
|
3
2
|
const g = async (e) => {
|
|
4
3
|
let t = !1, d = !1;
|
|
5
4
|
const o = [];
|
|
@@ -37,14 +36,14 @@ const g = async (e) => {
|
|
|
37
36
|
`), n = 1;
|
|
38
37
|
continue;
|
|
39
38
|
}
|
|
40
|
-
const i = e.vfs.readFile(r), a = await
|
|
39
|
+
const i = e.vfs.readFile(r), a = await l(i), f = r.slice(0, -3);
|
|
41
40
|
e.vfs.writeFile(f, a), t || e.vfs.unlink(r);
|
|
42
41
|
} else {
|
|
43
|
-
const i = e.vfs.readFile(r), a = await
|
|
42
|
+
const i = e.vfs.readFile(r), a = await u(i);
|
|
44
43
|
e.vfs.writeFile(r + ".gz", a), t || e.vfs.unlink(r);
|
|
45
44
|
}
|
|
46
45
|
} catch (i) {
|
|
47
|
-
if (i instanceof
|
|
46
|
+
if (i instanceof c)
|
|
48
47
|
e.stderr.write(`gzip: ${s}: ${i.message}
|
|
49
48
|
`), n = 1;
|
|
50
49
|
else
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { r as d, i as f, c as g, V as h } from "./index-CvsPTm3-.js";
|
|
2
|
+
const p = async (e) => {
|
|
3
|
+
let n = 10;
|
|
4
|
+
const r = [];
|
|
5
|
+
for (let s = 0; s < e.args.length; s++) {
|
|
6
|
+
const t = e.args[s];
|
|
7
|
+
if (t === "-n" && s + 1 < e.args.length) {
|
|
8
|
+
if (n = parseInt(e.args[++s], 10), isNaN(n))
|
|
9
|
+
return e.stderr.write(`head: invalid number of lines
|
|
10
|
+
`), 1;
|
|
11
|
+
} else /^-\d+$/.test(t) ? n = parseInt(t.slice(1), 10) : r.push(t);
|
|
12
|
+
}
|
|
13
|
+
async function a(s) {
|
|
14
|
+
const t = s.split(`
|
|
15
|
+
`);
|
|
16
|
+
let o = t.slice(0, n).join(`
|
|
17
|
+
`);
|
|
18
|
+
t.length > n && (o += `
|
|
19
|
+
`), e.stdout.write(o);
|
|
20
|
+
}
|
|
21
|
+
if (r.length === 0) {
|
|
22
|
+
if (e.stdin)
|
|
23
|
+
await a(await e.stdin.readAll());
|
|
24
|
+
else
|
|
25
|
+
return e.stderr.write(`head: missing file operand
|
|
26
|
+
`), 1;
|
|
27
|
+
return 0;
|
|
28
|
+
}
|
|
29
|
+
let l = 0;
|
|
30
|
+
for (const s of r) {
|
|
31
|
+
const t = d(e.cwd, s);
|
|
32
|
+
try {
|
|
33
|
+
if (e.vfs.stat(t), f(g(t))) {
|
|
34
|
+
e.stderr.write(`head: ${s}: binary file, skipping
|
|
35
|
+
`);
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
const i = e.vfs.readFileString(t);
|
|
39
|
+
r.length > 1 && e.stdout.write(`==> ${s} <==
|
|
40
|
+
`), await a(i);
|
|
41
|
+
} catch (i) {
|
|
42
|
+
if (i instanceof h)
|
|
43
|
+
e.stderr.write(`head: ${s}: ${i.message}
|
|
44
|
+
`), l = 1;
|
|
45
|
+
else
|
|
46
|
+
throw i;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return l;
|
|
50
|
+
};
|
|
51
|
+
export {
|
|
52
|
+
p as default
|
|
53
|
+
};
|