Skip to content

Commit 15c06f2

Browse files
fix: windows working dir
Signed-off-by: Victor Adossi <vadossi@cosmonic.com>
1 parent 9c93efc commit 15c06f2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/componentize.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export async function componentize(
9494

9595
let {
9696
sourceName = 'source.js',
97-
sourcePath = join(sourcesDir, sourceName),
97+
sourcePath = maybeWindowsPath(join(sourcesDir, sourceName)),
9898
preview2Adapter = preview1AdapterReactorPath(),
9999
witPath,
100100
witWorld,
@@ -131,7 +131,7 @@ export async function componentize(
131131
const outputWasmPath = join(workDir, 'out.wasm');
132132

133133
await writeFile(inputWasmPath, Buffer.from(wasm));
134-
let initializerPath = join(sourcesDir, 'initializer.js');
134+
let initializerPath = maybeWindowsPath(join(sourcesDir, 'initializer.js'));
135135
await writeFile(initializerPath, jsBindings);
136136

137137
if (debugBindings) {
@@ -484,15 +484,15 @@ function getEnginePath(opts) {
484484

485485
/** Prepare a work directory for use with componentization */
486486
async function prepWorkDir() {
487-
const baseDir = join(
487+
const baseDir = maybeWindowsPath(join(
488488
tmpdir(),
489489
createHash('sha256')
490490
.update(Math.random().toString())
491491
.digest('hex')
492492
.slice(0, 12),
493-
);
493+
));
494494
await mkdir(baseDir);
495-
const sourcesDir = join(baseDir, 'sources');
495+
const sourcesDir = maybeWindowsPath(join(baseDir, 'sources'));
496496
await mkdir(sourcesDir);
497497
return { baseDir, sourcesDir };
498498
}

0 commit comments

Comments
 (0)