From f5c8ae309c1433fba8a271ce78afe79622e952d2 Mon Sep 17 00:00:00 2001 From: CismonX Date: Sat, 2 Oct 2021 22:56:50 +0800 Subject: [PATCH] Bugfix for Windows builds. --- src/utils/converter.ts | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) 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)); }