Closed
Description
Re-post of angular/devkit#745
Bug Report or Feature Request (mark with an x
)
- [x] bug report -> please search issues before submitting
- [ ] feature request
Area
- [ ] devkit
- [x] schematics
Versions
Node v8.11.1
NPM 5.8.0
Mac OS High Sierra
Repro steps
Use the following schematic
import { Rule, url, apply, mergeWith, chain, MergeStrategy } from '@angular-devkit/schematics';
export function index(): Rule {
return chain([
simpleMerge(),
]);
}
function simpleMerge(): Rule {
const source = url('./files');
return mergeWith(source, MergeStrategy.Overwrite);
}
The log given by the failure
schematics .:boilerplate
ERROR! /src/app/app.component.html already exists.
ERROR! /src/app/app.component.spec.ts already exists.
ERROR! /src/app/app.component.ts already exists.
ERROR! /src/app/app.module.ts already exists.
ERROR! /src/assets/.gitkeep already exists.
ERROR! /src/environments/environment.prod.ts already exists.
ERROR! /src/environments/environment.ts already exists.
ERROR! /src/index.html already exists.
Desired functionality
All files should be overwritten.
Mention any other details that might be useful
I tried every MergeStrategy possible (AllowOverwriteConflict, etc.), same result.
angular/devkit#745
https://stackoverflow.com/questions/48957132/how-to-overwrite-file-with-angular-schematics