Skip to content

Commit

Permalink
Fix ChildProcessOnProject interface
Browse files Browse the repository at this point in the history
Use Partial<SpawnLogOptions> since a value is provided for the only
required parameter, log.
  • Loading branch information
David Dooling committed Apr 1, 2019
1 parent a207d2e commit 903693d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/api-helper/project/withProject.ts
Expand Up @@ -51,7 +51,7 @@ export interface ChildProcessOnProject {
* @param opts Spawn options
* @returns Command result
*/
spawn(cmd: string, args?: string | string[], opts?: SpawnLogOptions): Promise<SpawnLogResult>;
spawn(cmd: string, args?: string | string[], opts?: Partial<SpawnLogOptions>): Promise<SpawnLogResult>;

/**
* Spawn a child process, by default setting cwd to the directory
Expand Down Expand Up @@ -111,8 +111,10 @@ export function doWithProject(action: (pa: ProjectAwareGoalInvocation) => Promis
/**
* Return spawn function for project-aware goal invocations.
*/
function pagiSpawn(p: GitProject, log: ProgressLog): (cmd: string, args?: string | string[], opts?: SpawnLogOptions) => Promise<SpawnLogResult> {
return (cmd: string, args: string | string[] = [], opts?: SpawnLogOptions) => {
function pagiSpawn(p: GitProject, log: ProgressLog):
(cmd: string, args?: string | string[], opts?: Partial<SpawnLogOptions>) => Promise<SpawnLogResult> {

return (cmd: string, args: string | string[] = [], opts?: Partial<SpawnLogOptions>) => {
const optsToUse: SpawnLogOptions = {
cwd: p.baseDir,
log,
Expand Down

0 comments on commit 903693d

Please sign in to comment.