Skip to content

Commit

Permalink
0.13.3
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed Nov 7, 2023
1 parent 9dcf08b commit 040a149
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bytecodealliance/jco",
"version": "0.13.2",
"version": "0.13.3",
"description": "JavaScript tooling for working with WebAssembly Components",
"author": "Guy Bedford",
"bin": {
Expand All @@ -18,7 +18,7 @@
},
"type": "module",
"dependencies": {
"@bytecodealliance/preview2-shim": "0.0.20",
"@bytecodealliance/preview2-shim": "0.0.21",
"binaryen": "^111.0.0",
"chalk-template": "^0.4.0",
"commander": "^9.4.1",
Expand Down
14 changes: 6 additions & 8 deletions packages/preview2-shim/lib/nodejs/filesystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -428,15 +428,13 @@ export class FileSystem {
throw 'no-entry';
descriptor = bestPreopenMatch[0];
subpath = subpath.slice(bestPreopenMatch[1]);
if (subpath[0] === '/')
subpath = subpath.slice(1);
}
if (descriptor.#hostPreopen) {
if (subpath[0] === '/' || subpath.startsWith('.') && subpath[1] === '/' || subpath[1] === '.' && subpath[2] === '/') {
subpath = subpath.slice(subpath[1] === '/' ? 2 : 1);
return descriptor.#hostPreopen + (descriptor.#hostPreopen.endsWith('/') ? '' : '/') + subpath;
} else {
return fs.cwd + (fs.cwd.endsWith('/') ? '' : '/') + subpath;
}
}
if (subpath.startsWith('.'))
subpath = subpath.slice(subpath[1] === '/' ? 2 : 1);
if (descriptor.#hostPreopen)
return descriptor.#hostPreopen + (descriptor.#hostPreopen.endsWith('/') ? '' : '/') + subpath;
return descriptor.#fullPath + '/' + subpath;
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/preview2-shim/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bytecodealliance/preview2-shim",
"version": "0.0.20",
"version": "0.0.21",
"description": "WASI Preview2 shim for JS environments",
"author": "Guy Bedford, Eduardo Rodrigues<[email protected]>",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion src/jco.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ program
.name('jco')
.description(c`{bold jco - WebAssembly JS Component Tools}\n JS Component Transpilation Bindgen & Wasm Tools for JS`)
.usage('<command> [options]')
.version('0.13.2');
.version('0.13.3');

function myParseInt(value) {
return parseInt(value, 10);
Expand Down

0 comments on commit 040a149

Please sign in to comment.