Skip to content

Commit

Permalink
fix callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
idleberg committed Mar 22, 2024
1 parent c70a584 commit 022e7ca
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,19 @@ function inRange(value: number, min: number, max: number): boolean {

export async function mapArguments(args: string[], options: Makensis.CompilerOptions): Promise<Makensis.MapArguments> {
const pathToMakensis: string = options.pathToMakensis ? options.pathToMakensis : 'makensis';

const pathToWine: string = options.pathToWine ? options.pathToWine : 'wine';

const defaultArguments = {
json: options.json,
wine: options.wine,
onData: options.onData,
onClose: options.onClose,
onError: options.onError
};

let cmd: string;


if (platform() !== 'win32' && options.wine === true) {
console.warn('Wine support has been degraded to an experimental feature, but it will be continued to be supported for the time being.');

Expand All @@ -124,10 +132,7 @@ export async function mapArguments(args: string[], options: Makensis.CompilerOpt
return [
cmd,
args,
{
json: options.json,
wine: options.wine
},
defaultArguments,
];
}

Expand Down Expand Up @@ -212,7 +217,7 @@ export async function mapArguments(args: string[], options: Makensis.CompilerOpt
args = [...args, ...options.rawArguments];
}

return [cmd, args, { json: options.json, wine: options.wine }];
return [cmd, args, defaultArguments];
}

export function objectify(input: string, key: string | null): Makensis.Objectified | string {
Expand Down
3 changes: 3 additions & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ declare namespace Makensis {
events?: boolean;
json?: boolean;
wine?: boolean;
onData?: (data: CompilerData) => void;
onError?: (line: string) => void;
onClose?: (data: CompilerOutput) => void;
}

interface StreamOptions {
Expand Down

0 comments on commit 022e7ca

Please sign in to comment.