diff --git a/src/utils/converter.ts b/src/utils/converter.ts index c7ec4f9..e21711f 100644 --- a/src/utils/converter.ts +++ b/src/utils/converter.ts @@ -57,13 +57,28 @@ export default class Converter } constructor( - private readonly _path: string, + path: string, private readonly _initFile: string, private readonly _options: Options, private readonly _logger: Logger, - ) {} + ) { + if (process.platform === 'win32') { + // TODO: + // On Windows, when passing the path of input file to makeinfo, + // using backslashes in path name breaks some other command line + // options (notably, -I). + // Not sure if this is a bug of makeinfo, or perl, or neither. + // We should look into this issue sometime later. + this._path = path.replace(/\\/g, '/'); + } else { + this._path = path; + } + } + + private readonly _path: string; private _addIncludePaths(paths: readonly string[], options: string[]) { + if (paths.length === 0) return; const separator = process.platform === 'win32' ? ';' : ':'; options.push('-I', paths.join(separator)); }