Skip to content
This repository was archived by the owner on Apr 4, 2025. It is now read-only.
This repository was archived by the owner on Apr 4, 2025. It is now read-only.

MergeStrategy seems to be completely broken (mergeWith failure) #745

Closed
@kanidjar

Description

@kanidjar

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions