Bugfix for Windows builds.

This commit is contained in:
CismonX 2021-10-02 22:56:50 +08:00
parent 2fd2a025c3
commit f5c8ae309c
Signed by: cismonx
GPG Key ID: 3094873E29A482FB
1 changed files with 17 additions and 2 deletions

View File

@ -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));
}