Skip to content

Commit f98d4a0

Browse files
authored
Merge pull request #3 from unitario/pass-target-options
Fixed problem when a builder is calling another builder
2 parents 130e2b0 + 47f83b4 commit f98d4a0

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/builders/index.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { BuilderContext, BuilderOutput } from '@angular-devkit/architect'
1+
import { BuilderContext, BuilderOutput, ScheduleOptions } from '@angular-devkit/architect'
22
import { JsonObject } from '@angular-devkit/core'
33
import { bgGreen, bgRed, cyan, dim, inverse } from 'chalk'
44
import * as cluster from 'cluster'
@@ -279,9 +279,12 @@ export const scheduleBuilder = (
279279
// eslint-disable-next-line consistent-return
280280
const getBuilderCallback = (): Observable<BuilderOutput> => {
281281
if (is(String, builder)) {
282-
return from(context.context.scheduleBuilder(builder as string, { ...{ builderOptions } })).pipe(
283-
switchMap((builderRun) => builderRun.output)
284-
)
282+
return from(
283+
context.context.scheduleBuilder(builder as string, { ...{ builderOptions } }, ({
284+
target: context.context.target,
285+
logger: context.context.logger,
286+
} as unknown) as ScheduleOptions)
287+
).pipe(switchMap((builderRun) => builderRun.output))
285288
}
286289
if (is(Function, builder)) {
287290
const builderCallbackResult = (builder as BuilderCallback)(context)

0 commit comments

Comments
 (0)