just-bash 2.9.7 → 2.9.8

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.
@@ -6,6 +6,8 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
6
6
  });
7
7
 
8
8
  // src/commands/python3/worker.ts
9
+ import { createRequire } from "node:module";
10
+ import { dirname } from "node:path";
9
11
  import { parentPort, workerData } from "node:worker_threads";
10
12
  import { loadPyodide } from "pyodide";
11
13
 
@@ -208,9 +210,9 @@ var IS_BROWSER = typeof __BROWSER__ !== "undefined" && __BROWSER__;
208
210
  var AsyncLocalStorageClass = null;
209
211
  if (!IS_BROWSER) {
210
212
  try {
211
- const { createRequire } = await import("node:module");
212
- const require2 = createRequire(import.meta.url);
213
- const asyncHooks = require2("node:async_hooks");
213
+ const { createRequire: createRequire2 } = await import("node:module");
214
+ const require3 = createRequire2(import.meta.url);
215
+ const asyncHooks = require3("node:async_hooks");
214
216
  AsyncLocalStorageClass = asyncHooks.AsyncLocalStorage;
215
217
  } catch (e) {
216
218
  console.debug(
@@ -1314,6 +1316,8 @@ var SyncFsBackend = class {
1314
1316
  // src/commands/python3/worker.ts
1315
1317
  var pyodideInstance = null;
1316
1318
  var pyodideLoading = null;
1319
+ var require2 = createRequire(import.meta.url);
1320
+ var pyodideIndexURL = `${dirname(require2.resolve("pyodide/pyodide.mjs"))}/`;
1317
1321
  async function getPyodide() {
1318
1322
  if (pyodideInstance) {
1319
1323
  return pyodideInstance;
@@ -1321,7 +1325,7 @@ async function getPyodide() {
1321
1325
  if (pyodideLoading) {
1322
1326
  return pyodideLoading;
1323
1327
  }
1324
- pyodideLoading = loadPyodide();
1328
+ pyodideLoading = loadPyodide({ indexURL: pyodideIndexURL });
1325
1329
  pyodideInstance = await pyodideLoading;
1326
1330
  return pyodideInstance;
1327
1331
  }
@@ -634,7 +634,7 @@ ${e} ()
634
634
  `),r=e.includes(" "),i=e.includes("\\"),o=e.includes("'");if(s||n||r||i){let c="";for(let l of e){let u=l.charCodeAt(0);l===`
635
635
  `?c+="\\n":l===" "?c+="\\t":l==="\\"?c+="\\\\":l==="'"?c+="'":l==='"'?c+='"':u<32||u===127?u<256?c+=`\\x${u.toString(16).padStart(2,"0")}`:c+=`\\u${u.toString(16).padStart(4,"0")}`:c+=l}return`$'${c}'`}return o?`"${e.replace(/([\\$`"])/g,"\\$1")}"`:`'${e}'`}async function Nr(e,t,s){if(!e.state.options.xtrace)return"";let n=await kr(e),r=[t,...s],i=ro(r);return`${n}${i}
636
636
  `}async function Or(e,t,s){return e.state.options.xtrace?`${await kr(e)}${t}=${s}
637
- `:""}async function xr(e,t,s){let n=t.timed?performance.now():0,r="",i=L,o=0,a=[],c=t.commands.length>1,l=e.state.lastArg;for(let f=0;f<t.commands.length;f++){let d=t.commands[f],h=f===t.commands.length-1;c&&(e.state.lastArg="");let p=c&&(!h||!e.state.shoptOptions.lastpipe)?new Map(e.state.env):null,g;try{g=await s(d,r)}catch($){if($ instanceof lt)g={stdout:$.stdout,stderr:$.stderr,exitCode:1};else if($ instanceof V&&t.commands.length>1)g={stdout:$.stdout,stderr:$.stderr,exitCode:$.exitCode};else if($ instanceof ue&&t.commands.length>1)g={stdout:$.stdout,stderr:$.stderr,exitCode:$.exitCode};else throw p&&(e.state.env=p),$}p&&(e.state.env=p),a.push(g.exitCode),g.exitCode!==0&&(o=g.exitCode),h?i=g:t.pipeStderr?.[f]??!1?(r=g.stderr+g.stdout,i={stdout:"",stderr:"",exitCode:g.exitCode}):(r=g.stdout,i={stdout:"",stderr:g.stderr,exitCode:g.exitCode})}if(t.commands.length>1||t.commands.length===1&&t.commands[0].type==="SimpleCommand"){for(let f of e.state.env.keys())f.startsWith("PIPESTATUS_")&&e.state.env.delete(f);for(let f=0;f<a.length;f++)e.state.env.set(`PIPESTATUS_${f}`,String(a[f]));e.state.env.set("PIPESTATUS__length",String(a.length))}if(e.state.options.pipefail&&o!==0&&(i={...i,exitCode:o}),t.negated&&(i={...i,exitCode:i.exitCode===0?1:0}),t.timed){let d=(performance.now()-n)/1e3,h=Math.floor(d/60),m=d%60,p;t.timePosix?p=`real ${d.toFixed(2)}
637
+ `:""}async function xr(e,t,s){let n=t.timed?performance.now():0,r="",i=L,o=0,a=[],c=t.commands.length>1,l=e.state.lastArg;for(let f=0;f<t.commands.length;f++){let d=t.commands[f],h=f===t.commands.length-1,m=f===0;c&&(e.state.lastArg="",m||(e.state.groupStdin=void 0));let g=c&&(!h||!e.state.shoptOptions.lastpipe)?new Map(e.state.env):null,$;try{$=await s(d,r)}catch(v){if(v instanceof lt)$={stdout:v.stdout,stderr:v.stderr,exitCode:1};else if(v instanceof V&&t.commands.length>1)$={stdout:v.stdout,stderr:v.stderr,exitCode:v.exitCode};else if(v instanceof ue&&t.commands.length>1)$={stdout:v.stdout,stderr:v.stderr,exitCode:v.exitCode};else throw g&&(e.state.env=g),v}g&&(e.state.env=g),a.push($.exitCode),$.exitCode!==0&&(o=$.exitCode),h?i=$:t.pipeStderr?.[f]??!1?(r=$.stderr+$.stdout,i={stdout:"",stderr:"",exitCode:$.exitCode}):(r=$.stdout,i={stdout:"",stderr:$.stderr,exitCode:$.exitCode})}if(t.commands.length>1||t.commands.length===1&&t.commands[0].type==="SimpleCommand"){for(let f of e.state.env.keys())f.startsWith("PIPESTATUS_")&&e.state.env.delete(f);for(let f=0;f<a.length;f++)e.state.env.set(`PIPESTATUS_${f}`,String(a[f]));e.state.env.set("PIPESTATUS__length",String(a.length))}if(e.state.options.pipefail&&o!==0&&(i={...i,exitCode:o}),t.negated&&(i={...i,exitCode:i.exitCode===0?1:0}),t.timed){let d=(performance.now()-n)/1e3,h=Math.floor(d/60),m=d%60,p;t.timePosix?p=`real ${d.toFixed(2)}
638
638
  user 0.00
639
639
  sys 0.00
640
640
  `:p=`
@@ -634,7 +634,7 @@ ${e} ()
634
634
  `),r=e.includes(" "),i=e.includes("\\"),o=e.includes("'");if(s||n||r||i){let c="";for(let l of e){let u=l.charCodeAt(0);l===`
635
635
  `?c+="\\n":l===" "?c+="\\t":l==="\\"?c+="\\\\":l==="'"?c+="'":l==='"'?c+='"':u<32||u===127?u<256?c+=`\\x${u.toString(16).padStart(2,"0")}`:c+=`\\u${u.toString(16).padStart(4,"0")}`:c+=l}return`$'${c}'`}return o?`"${e.replace(/([\\$`"])/g,"\\$1")}"`:`'${e}'`}async function xr(e,t,s){if(!e.state.options.xtrace)return"";let n=await Or(e),r=[t,...s],i=oo(r);return`${n}${i}
636
636
  `}async function Dr(e,t,s){return e.state.options.xtrace?`${await Or(e)}${t}=${s}
637
- `:""}async function Tr(e,t,s){let n=t.timed?performance.now():0,r="",i=L,o=0,a=[],c=t.commands.length>1,l=e.state.lastArg;for(let f=0;f<t.commands.length;f++){let d=t.commands[f],h=f===t.commands.length-1;c&&(e.state.lastArg="");let p=c&&(!h||!e.state.shoptOptions.lastpipe)?new Map(e.state.env):null,g;try{g=await s(d,r)}catch(S){if(S instanceof lt)g={stdout:S.stdout,stderr:S.stderr,exitCode:1};else if(S instanceof V&&t.commands.length>1)g={stdout:S.stdout,stderr:S.stderr,exitCode:S.exitCode};else if(S instanceof fe&&t.commands.length>1)g={stdout:S.stdout,stderr:S.stderr,exitCode:S.exitCode};else throw p&&(e.state.env=p),S}p&&(e.state.env=p),a.push(g.exitCode),g.exitCode!==0&&(o=g.exitCode),h?i=g:t.pipeStderr?.[f]??!1?(r=g.stderr+g.stdout,i={stdout:"",stderr:"",exitCode:g.exitCode}):(r=g.stdout,i={stdout:"",stderr:g.stderr,exitCode:g.exitCode})}if(t.commands.length>1||t.commands.length===1&&t.commands[0].type==="SimpleCommand"){for(let f of e.state.env.keys())f.startsWith("PIPESTATUS_")&&e.state.env.delete(f);for(let f=0;f<a.length;f++)e.state.env.set(`PIPESTATUS_${f}`,String(a[f]));e.state.env.set("PIPESTATUS__length",String(a.length))}if(e.state.options.pipefail&&o!==0&&(i={...i,exitCode:o}),t.negated&&(i={...i,exitCode:i.exitCode===0?1:0}),t.timed){let d=(performance.now()-n)/1e3,h=Math.floor(d/60),m=d%60,p;t.timePosix?p=`real ${d.toFixed(2)}
637
+ `:""}async function Tr(e,t,s){let n=t.timed?performance.now():0,r="",i=L,o=0,a=[],c=t.commands.length>1,l=e.state.lastArg;for(let f=0;f<t.commands.length;f++){let d=t.commands[f],h=f===t.commands.length-1,m=f===0;c&&(e.state.lastArg="",m||(e.state.groupStdin=void 0));let g=c&&(!h||!e.state.shoptOptions.lastpipe)?new Map(e.state.env):null,S;try{S=await s(d,r)}catch(v){if(v instanceof lt)S={stdout:v.stdout,stderr:v.stderr,exitCode:1};else if(v instanceof V&&t.commands.length>1)S={stdout:v.stdout,stderr:v.stderr,exitCode:v.exitCode};else if(v instanceof fe&&t.commands.length>1)S={stdout:v.stdout,stderr:v.stderr,exitCode:v.exitCode};else throw g&&(e.state.env=g),v}g&&(e.state.env=g),a.push(S.exitCode),S.exitCode!==0&&(o=S.exitCode),h?i=S:t.pipeStderr?.[f]??!1?(r=S.stderr+S.stdout,i={stdout:"",stderr:"",exitCode:S.exitCode}):(r=S.stdout,i={stdout:"",stderr:S.stderr,exitCode:S.exitCode})}if(t.commands.length>1||t.commands.length===1&&t.commands[0].type==="SimpleCommand"){for(let f of e.state.env.keys())f.startsWith("PIPESTATUS_")&&e.state.env.delete(f);for(let f=0;f<a.length;f++)e.state.env.set(`PIPESTATUS_${f}`,String(a[f]));e.state.env.set("PIPESTATUS__length",String(a.length))}if(e.state.options.pipefail&&o!==0&&(i={...i,exitCode:o}),t.negated&&(i={...i,exitCode:i.exitCode===0?1:0}),t.timed){let d=(performance.now()-n)/1e3,h=Math.floor(d/60),m=d%60,p;t.timePosix?p=`real ${d.toFixed(2)}
638
638
  user 0.00
639
639
  sys 0.00
640
640
  `:p=`
@@ -1418,7 +1418,7 @@ ${e} ()
1418
1418
  `),s=e.includes(" "),i=e.includes("\\"),o=e.includes("'");if(n||r||s||i){let l="";for(let c of e){let u=c.charCodeAt(0);c===`
1419
1419
  `?l+="\\n":c===" "?l+="\\t":c==="\\"?l+="\\\\":c==="'"?l+="'":c==='"'?l+='"':u<32||u===127?u<256?l+=`\\x${u.toString(16).padStart(2,"0")}`:l+=`\\u${u.toString(16).padStart(4,"0")}`:l+=c}return`$'${l}'`}return o?`"${e.replace(/([\\$`"])/g,"\\$1")}"`:`'${e}'`}async function mg(e,t,n){if(!e.state.options.xtrace)return"";let r=await dg(e),s=[t,...n],i=FE(s);return`${r}${i}
1420
1420
  `}async function gg(e,t,n){return e.state.options.xtrace?`${await dg(e)}${t}=${n}
1421
- `:""}ye();async function yg(e,t,n){let r=t.timed?performance.now():0,s="",i=de,o=0,a=[],l=t.commands.length>1,c=e.state.lastArg;for(let f=0;f<t.commands.length;f++){let p=t.commands[f],h=f===t.commands.length-1;l&&(e.state.lastArg="");let d=l&&(!h||!e.state.shoptOptions.lastpipe)?new Map(e.state.env):null,g;try{g=await n(p,s)}catch(y){if(y instanceof wt)g={stdout:y.stdout,stderr:y.stderr,exitCode:1};else if(y instanceof pe&&t.commands.length>1)g={stdout:y.stdout,stderr:y.stderr,exitCode:y.exitCode};else if(y instanceof kt&&t.commands.length>1)g={stdout:y.stdout,stderr:y.stderr,exitCode:y.exitCode};else throw d&&(e.state.env=d),y}d&&(e.state.env=d),a.push(g.exitCode),g.exitCode!==0&&(o=g.exitCode),h?i=g:t.pipeStderr?.[f]??!1?(s=g.stderr+g.stdout,i={stdout:"",stderr:"",exitCode:g.exitCode}):(s=g.stdout,i={stdout:"",stderr:g.stderr,exitCode:g.exitCode})}if(t.commands.length>1||t.commands.length===1&&t.commands[0].type==="SimpleCommand"){for(let f of e.state.env.keys())f.startsWith("PIPESTATUS_")&&e.state.env.delete(f);for(let f=0;f<a.length;f++)e.state.env.set(`PIPESTATUS_${f}`,String(a[f]));e.state.env.set("PIPESTATUS__length",String(a.length))}if(e.state.options.pipefail&&o!==0&&(i={...i,exitCode:o}),t.negated&&(i={...i,exitCode:i.exitCode===0?1:0}),t.timed){let p=(performance.now()-r)/1e3,h=Math.floor(p/60),m=p%60,d;t.timePosix?d=`real ${p.toFixed(2)}
1421
+ `:""}ye();async function yg(e,t,n){let r=t.timed?performance.now():0,s="",i=de,o=0,a=[],l=t.commands.length>1,c=e.state.lastArg;for(let f=0;f<t.commands.length;f++){let p=t.commands[f],h=f===t.commands.length-1,m=f===0;l&&(e.state.lastArg="",m||(e.state.groupStdin=void 0));let g=l&&(!h||!e.state.shoptOptions.lastpipe)?new Map(e.state.env):null,y;try{y=await n(p,s)}catch(w){if(w instanceof wt)y={stdout:w.stdout,stderr:w.stderr,exitCode:1};else if(w instanceof pe&&t.commands.length>1)y={stdout:w.stdout,stderr:w.stderr,exitCode:w.exitCode};else if(w instanceof kt&&t.commands.length>1)y={stdout:w.stdout,stderr:w.stderr,exitCode:w.exitCode};else throw g&&(e.state.env=g),w}g&&(e.state.env=g),a.push(y.exitCode),y.exitCode!==0&&(o=y.exitCode),h?i=y:t.pipeStderr?.[f]??!1?(s=y.stderr+y.stdout,i={stdout:"",stderr:"",exitCode:y.exitCode}):(s=y.stdout,i={stdout:"",stderr:y.stderr,exitCode:y.exitCode})}if(t.commands.length>1||t.commands.length===1&&t.commands[0].type==="SimpleCommand"){for(let f of e.state.env.keys())f.startsWith("PIPESTATUS_")&&e.state.env.delete(f);for(let f=0;f<a.length;f++)e.state.env.set(`PIPESTATUS_${f}`,String(a[f]));e.state.env.set("PIPESTATUS__length",String(a.length))}if(e.state.options.pipefail&&o!==0&&(i={...i,exitCode:o}),t.negated&&(i={...i,exitCode:i.exitCode===0?1:0}),t.timed){let p=(performance.now()-r)/1e3,h=Math.floor(p/60),m=p%60,d;t.timePosix?d=`real ${p.toFixed(2)}
1422
1422
  user 0.00
1423
1423
  sys 0.00
1424
1424
  `:d=`
@@ -6,6 +6,8 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
6
6
  });
7
7
 
8
8
  // src/commands/python3/worker.ts
9
+ import { createRequire } from "node:module";
10
+ import { dirname } from "node:path";
9
11
  import { parentPort, workerData } from "node:worker_threads";
10
12
  import { loadPyodide } from "pyodide";
11
13
 
@@ -208,9 +210,9 @@ var IS_BROWSER = typeof __BROWSER__ !== "undefined" && __BROWSER__;
208
210
  var AsyncLocalStorageClass = null;
209
211
  if (!IS_BROWSER) {
210
212
  try {
211
- const { createRequire } = await import("node:module");
212
- const require2 = createRequire(import.meta.url);
213
- const asyncHooks = require2("node:async_hooks");
213
+ const { createRequire: createRequire2 } = await import("node:module");
214
+ const require3 = createRequire2(import.meta.url);
215
+ const asyncHooks = require3("node:async_hooks");
214
216
  AsyncLocalStorageClass = asyncHooks.AsyncLocalStorage;
215
217
  } catch (e) {
216
218
  console.debug(
@@ -1314,6 +1316,8 @@ var SyncFsBackend = class {
1314
1316
  // src/commands/python3/worker.ts
1315
1317
  var pyodideInstance = null;
1316
1318
  var pyodideLoading = null;
1319
+ var require2 = createRequire(import.meta.url);
1320
+ var pyodideIndexURL = `${dirname(require2.resolve("pyodide/pyodide.mjs"))}/`;
1317
1321
  async function getPyodide() {
1318
1322
  if (pyodideInstance) {
1319
1323
  return pyodideInstance;
@@ -1321,7 +1325,7 @@ async function getPyodide() {
1321
1325
  if (pyodideLoading) {
1322
1326
  return pyodideLoading;
1323
1327
  }
1324
- pyodideLoading = loadPyodide();
1328
+ pyodideLoading = loadPyodide({ indexURL: pyodideIndexURL });
1325
1329
  pyodideInstance = await pyodideLoading;
1326
1330
  return pyodideInstance;
1327
1331
  }
@@ -633,7 +633,7 @@ ${e} ()
633
633
  `),n=e.includes(" "),i=e.includes("\\"),o=e.includes("'");if(s||r||n||i){let l="";for(let c of e){let u=c.charCodeAt(0);c===`
634
634
  `?l+="\\n":c===" "?l+="\\t":c==="\\"?l+="\\\\":c==="'"?l+="'":c==='"'?l+='"':u<32||u===127?u<256?l+=`\\x${u.toString(16).padStart(2,"0")}`:l+=`\\u${u.toString(16).padStart(4,"0")}`:l+=c}return`$'${l}'`}return o?`"${e.replace(/([\\$`"])/g,"\\$1")}"`:`'${e}'`}async function Ln(e,t,s){if(!e.state.options.xtrace)return"";let r=await Fn(e),n=[t,...s],i=mo(n);return`${r}${i}
635
635
  `}async function Wn(e,t,s){return e.state.options.xtrace?`${await Fn(e)}${t}=${s}
636
- `:""}async function zn(e,t,s){let r=t.timed?performance.now():0,n="",i=M,o=0,a=[],l=t.commands.length>1,c=e.state.lastArg;for(let f=0;f<t.commands.length;f++){let d=t.commands[f],h=f===t.commands.length-1;l&&(e.state.lastArg="");let p=l&&(!h||!e.state.shoptOptions.lastpipe)?new Map(e.state.env):null,g;try{g=await s(d,n)}catch(S){if(S instanceof pt)g={stdout:S.stdout,stderr:S.stderr,exitCode:1};else if(S instanceof z&&t.commands.length>1)g={stdout:S.stdout,stderr:S.stderr,exitCode:S.exitCode};else if(S instanceof de&&t.commands.length>1)g={stdout:S.stdout,stderr:S.stderr,exitCode:S.exitCode};else throw p&&(e.state.env=p),S}p&&(e.state.env=p),a.push(g.exitCode),g.exitCode!==0&&(o=g.exitCode),h?i=g:t.pipeStderr?.[f]??!1?(n=g.stderr+g.stdout,i={stdout:"",stderr:"",exitCode:g.exitCode}):(n=g.stdout,i={stdout:"",stderr:g.stderr,exitCode:g.exitCode})}if(t.commands.length>1||t.commands.length===1&&t.commands[0].type==="SimpleCommand"){for(let f of e.state.env.keys())f.startsWith("PIPESTATUS_")&&e.state.env.delete(f);for(let f=0;f<a.length;f++)e.state.env.set(`PIPESTATUS_${f}`,String(a[f]));e.state.env.set("PIPESTATUS__length",String(a.length))}if(e.state.options.pipefail&&o!==0&&(i={...i,exitCode:o}),t.negated&&(i={...i,exitCode:i.exitCode===0?1:0}),t.timed){let d=(performance.now()-r)/1e3,h=Math.floor(d/60),m=d%60,p;t.timePosix?p=`real ${d.toFixed(2)}
636
+ `:""}async function zn(e,t,s){let r=t.timed?performance.now():0,n="",i=M,o=0,a=[],l=t.commands.length>1,c=e.state.lastArg;for(let f=0;f<t.commands.length;f++){let d=t.commands[f],h=f===t.commands.length-1,m=f===0;l&&(e.state.lastArg="",m||(e.state.groupStdin=void 0));let g=l&&(!h||!e.state.shoptOptions.lastpipe)?new Map(e.state.env):null,S;try{S=await s(d,n)}catch(v){if(v instanceof pt)S={stdout:v.stdout,stderr:v.stderr,exitCode:1};else if(v instanceof z&&t.commands.length>1)S={stdout:v.stdout,stderr:v.stderr,exitCode:v.exitCode};else if(v instanceof de&&t.commands.length>1)S={stdout:v.stdout,stderr:v.stderr,exitCode:v.exitCode};else throw g&&(e.state.env=g),v}g&&(e.state.env=g),a.push(S.exitCode),S.exitCode!==0&&(o=S.exitCode),h?i=S:t.pipeStderr?.[f]??!1?(n=S.stderr+S.stdout,i={stdout:"",stderr:"",exitCode:S.exitCode}):(n=S.stdout,i={stdout:"",stderr:S.stderr,exitCode:S.exitCode})}if(t.commands.length>1||t.commands.length===1&&t.commands[0].type==="SimpleCommand"){for(let f of e.state.env.keys())f.startsWith("PIPESTATUS_")&&e.state.env.delete(f);for(let f=0;f<a.length;f++)e.state.env.set(`PIPESTATUS_${f}`,String(a[f]));e.state.env.set("PIPESTATUS__length",String(a.length))}if(e.state.options.pipefail&&o!==0&&(i={...i,exitCode:o}),t.negated&&(i={...i,exitCode:i.exitCode===0?1:0}),t.timed){let d=(performance.now()-r)/1e3,h=Math.floor(d/60),m=d%60,p;t.timePosix?p=`real ${d.toFixed(2)}
637
637
  user 0.00
638
638
  sys 0.00
639
639
  `:p=`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "just-bash",
3
- "version": "2.9.7",
3
+ "version": "2.9.8",
4
4
  "description": "A simulated bash environment with virtual filesystem",
5
5
  "repository": {
6
6
  "type": "git",