just-bash 1.3.1 → 1.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/README.md CHANGED
@@ -233,15 +233,15 @@ pnpm shell --no-network
233
233
 
234
234
  ### File Operations
235
235
 
236
- `cat`, `cp`, `ln`, `ls`, `mkdir`, `mv`, `readlink`, `rm`, `stat`, `touch`, `tree`
236
+ `cat`, `cp`, `file`, `ln`, `ls`, `mkdir`, `mv`, `readlink`, `rm`, `stat`, `touch`, `tree`
237
237
 
238
238
  ### Text Processing
239
239
 
240
- `awk`, `base64`, `comm`, `cut`, `diff`, `grep`, `head`, `jq`, `md5sum`, `printf`, `sed`, `sha1sum`, `sha256sum`, `sort`, `tail`, `tr`, `uniq`, `wc`, `xargs`
240
+ `awk`, `base64`, `comm`, `cut`, `diff`, `grep` (+ `egrep`, `fgrep`), `head`, `jq`, `md5sum`, `od`, `paste`, `printf`, `sed`, `sha1sum`, `sha256sum`, `sort`, `tac`, `tail`, `tr`, `uniq`, `wc`, `xargs`
241
241
 
242
242
  ### Navigation & Environment
243
243
 
244
- `basename`, `cd`, `dirname`, `du`, `echo`, `env`, `export`, `find`, `printenv`, `pwd`, `tee`
244
+ `basename`, `cd`, `dirname`, `du`, `echo`, `env`, `export`, `find`, `hostname`, `printenv`, `pwd`, `tee`
245
245
 
246
246
  ### Shell Utilities
247
247
 
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import"./chunk-SJXDWN5X.js";async function t(e,n){return{stdout:`localhost
3
+ `,stderr:"",exitCode:0}}var o={name:"hostname",execute:t};export{o as hostname};
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env node
2
+ import"./chunk-SJXDWN5X.js";async function f(h,l){let u=h.includes("-c"),i=h.includes("-An")?"none":"octal",o=l.stdin,s=h.filter(t=>!t.startsWith("-")&&t!=="-");if(s.length>0){let t=s[0].startsWith("/")?s[0]:`${l.cwd}/${s[0]}`;try{o=await l.fs.readFile(t)}catch{return{stdout:"",stderr:`od: ${s[0]}: No such file or directory
3
+ `,exitCode:1}}}if(u){let t=[];for(let e of o){let n=e.charCodeAt(0);n===0?t.push("\\0"):n===9?t.push("\\t"):n===10?t.push("\\n"):n===13?t.push("\\r"):n===32?t.push(" "):n>=32&&n<127?t.push(` ${e}`):t.push(`\\${n.toString(8).padStart(3,"0")}`)}let r=[];for(let e=0;e<t.length;e+=16){let n=t.slice(e,e+16),a=i==="none"?"":`${e.toString(8).padStart(7,"0")} `;r.push(a+n.join(" "))}return i!=="none"&&r.push(o.length.toString(8).padStart(7,"0")),{stdout:`${r.join(`
4
+ `)}
5
+ `,stderr:"",exitCode:0}}let c=[];for(let t of o)c.push(t.charCodeAt(0).toString(8).padStart(3,"0"));let d=[];for(let t=0;t<c.length;t+=8){let r=c.slice(t,t+8),e=i==="none"?"":`${t.toString(8).padStart(7,"0")} `;d.push(e+r.join(" "))}return i!=="none"&&c.length>0&&d.push(o.length.toString(8).padStart(7,"0")),{stdout:d.length>0?`${d.join(`
6
+ `)}
7
+ `:"",stderr:"",exitCode:0}}var p={name:"od",execute:f};export{p as od};
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env node
2
+ import"./chunk-SJXDWN5X.js";async function i(t,o){if(t.length>0&&t[0]!=="-"){let c=t[0].startsWith("/")?t[0]:`${o.cwd}/${t[0]}`;try{let n=(await o.fs.readFile(c)).split(`
3
+ `);n[n.length-1]===""&&n.pop();let s=n.reverse();return{stdout:s.length>0?`${s.join(`
4
+ `)}
5
+ `:"",stderr:"",exitCode:0}}catch{return{stdout:"",stderr:`tac: ${t[0]}: No such file or directory
6
+ `,exitCode:1}}}let e=o.stdin.split(`
7
+ `);e[e.length-1]===""&&e.pop();let r=e.reverse();return{stdout:r.length>0?`${r.join(`
8
+ `)}
9
+ `:"",stderr:"",exitCode:0}}var l={name:"tac",execute:i};export{l as tac};