Skip to content

Commit c56e7c5

Browse files
committed
fix: fixing process run on Windows
Signed-off-by: Pawel Psztyc <jarrodek@gmail.com>
1 parent 6c8d950 commit c56e7c5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/AmfParser.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { Duplex } from 'stream';
55
import unzipper from 'unzipper';
66
import fs from 'fs-extra';
77
import path from 'path';
8+
import { fileURLToPath } from 'url';
89
import { ApiSearch } from './ApiSearch.js';
910

1011
/** @typedef {import('child_process').ChildProcess} ChildProcess */
@@ -134,8 +135,8 @@ export class AmfParser {
134135
execArgv: [],
135136
env
136137
};
137-
const processDir = import.meta.url.replace('AmfParser.js', '').replace('file:', '');
138-
const proc = fork(`${processDir}/ParserProcess.js`, options);
138+
const processDir = fileURLToPath(import.meta.url).replace('AmfParser.js', '');
139+
const proc = fork(path.join(processDir, 'ParserProcess.js'), options);
139140
// the very first message from the child process is that the process started
140141
// and is ready to receive data.
141142
proc.once('message', () => {

0 commit comments

Comments
 (0)