Bug Report or Feature Request (mark with an x)
- [x] bug report -> please search issues before submitting
- [ ] feature request
Area
- [x] devkit
- [ ] schematics
Versions
@angular/cli@6.1.0.rc.0
Repro steps
When I run a schematic like:
let x = 1;
export default function(_options: any): Rule {
return chain([
() => {
console.log(`Say it #${x++}`);
},
addSebastian,
addCharles,
addHans
]);
}
const addSebastian = () => {
const templateOptions = {
name: 'sebastian'
};
const templateSource = apply(url('./_files'), [
template(templateOptions)
]);
return mergeWith(templateSource);
}
const addCharles = () => {
const templateOptions = {
name: 'charles'
};
const templateSource = apply(url('./_files'), [
template(templateOptions)
]);
return mergeWith(templateSource);
}
const addHans = () => {
const templateOptions = {
name: 'hans'
};
const templateSource = apply(url('./_files'), [
template(templateOptions)
]);
return mergeWith(templateSource);
}
I get a message printed in the first step 8 times. Which suggests that the step runs 8 times.
I would expect it to be executed only once.
You can easily reproduce the issue with this project.
https://github.com/sebawita/sample
The log given by the failure

Desired functionality
I only expect Say it #1 to be displayed, but not the other 7
Bug Report or Feature Request (mark with an
x)Area
Versions
@angular/cli@6.1.0.rc.0Repro steps
When I run a schematic like:
I get a message printed in the first step 8 times. Which suggests that the step runs 8 times.
I would expect it to be executed only once.
You can easily reproduce the issue with this project.
https://github.com/sebawita/sample
The log given by the failure
Desired functionality
I only expect
Say it #1to be displayed, but not the other 7