Skip to content

Commit

Permalink
improve types
Browse files Browse the repository at this point in the history
  • Loading branch information
idleberg committed Mar 22, 2024
1 parent 53f7f2d commit e27fb15
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/commands.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { mapArguments, objectify, spawnMakensis, splitCommands } from './util';

import type { SpawnOptions } from 'node:child_process';
import type Makensis from '../types';

/**
* Returns usage information for a command, or list all commands
Expand Down Expand Up @@ -74,7 +75,7 @@ export async function license(compilerOptions: Makensis.CompilerOptions = {}, sp
* @param compilerOptions - compiler options
* @returns - NSIS directory
*/
export async function nsisDir(compilerOptions: Makensis.CompilerOptions = {}): Promise<string | JSON> {
export async function nsisDir(compilerOptions: Makensis.CompilerOptions = {}): Promise<string | Makensis.CompilerOutput> {
const hdrOptions: Makensis.CompilerOptions = { ...compilerOptions, json: true };

// eslint-disable-next-line @typescript-eslint/no-explicit-any
Expand Down
2 changes: 2 additions & 0 deletions src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { platform } from 'node:os';
import { spawn } from 'node:child_process';

import type { ChildProcess, SpawnOptions } from 'node:child_process';
import type Makensis from '../types';

function detectOutfile(str: string): null | string {
if (str.includes('Output: "')) {
Expand Down Expand Up @@ -347,6 +348,7 @@ export function spawnMakensis(cmd: string, args: Array<string>, compilerOptions:

child.stdout?.on('data', (data: Buffer) => {
const line = data.toString();

stream.stdout += line;
const warnings = hasWarnings(line);

Expand Down

0 comments on commit e27fb15

Please sign in to comment.