Skip to content

Rename file, then create a new file with the same as the renamed file fails. #12140

@alexeagle

Description

@alexeagle

From @sebawita on March 9, 2018 15:32

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Area

- [ ] devkit
- [x] schematics

Versions

    "@angular-devkit/core": "^0.4.5",
    "@angular-devkit/schematics": "^0.4.5",
    "@schematics/angular": "^0.4.5",

Repro steps

Run a schematic with a file called test.txt

tree.rename('test.txt', 'other.txt');
tree.create('test.txt', 'content');

This will fail saying error! test.txt already exists.

Also the same happens, when I use apply url, that generates a previously renamed file.

tree.rename('test.txt', 'other.txt');
apply(url('./_files'), ...)

The log given by the failure

error! filename already exists.

Desired functionality

It should be possible to create a file that was previously deleted or renamed.

Mention any other details that might be useful

Copied from original issue: angular/devkit#491

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions