Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(@angular-devkit/schematics): Fix merge that causes an overwrite #19878

Merged
merged 1 commit into from Jan 28, 2021

Conversation

@Brocco
Copy link
Contributor

@Brocco Brocco commented Jan 26, 2021

This fixes #11337 to allow for merging of a tree with another when the the file already exists in the tree being merged into.

@google-cla google-cla bot added the cla: yes label Jan 26, 2021
@@ -180,7 +180,7 @@ export class HostTree implements Tree {
case 'c': {
const { path, content } = action;

if ((this._willCreate(path) || this._willOverwrite(path))) {
if ((this._willCreate(path) || this._willOverwrite(path) || this.exists(path))) {

This comment has been minimized.

@Brocco

Brocco Jan 26, 2021
Author Contributor

This new check determines if the file already exists versus being created or overwritten.

@Brocco Brocco force-pushed the Brocco:schematic-overwrite-fix branch 2 times, most recently from 694e312 to b10d482 Jan 26, 2021
Copy link
Member

@clydin clydin left a comment

Looks like at least one E2E test is failing as well.
node ./tests/legacy-cli/run_e2e.js ./tests/legacy-cli/e2e/tests/generate/component/component-duplicate.ts

@Brocco Brocco force-pushed the Brocco:schematic-overwrite-fix branch 3 times, most recently from 0f39a57 to df6dd97 Jan 26, 2021
@Brocco Brocco force-pushed the Brocco:schematic-overwrite-fix branch 2 times, most recently from 8bf63b6 to 21f15fc Jan 27, 2021
This fixes #11337 to allow for merging of a tree with another when the the file already exists in the tree being merged into.
@Brocco Brocco force-pushed the Brocco:schematic-overwrite-fix branch from 21f15fc to 39e584f Jan 27, 2021
@clydin
clydin approved these changes Jan 27, 2021
@alan-agius4 alan-agius4 merged commit a179828 into angular:master Jan 28, 2021
15 checks passed
15 checks passed
Inclusive Language Check completed with success
Details
ci/angular: merge status All checks passed!
ci/angular: size No size change against base branch.
ci/circleci: build Your tests passed on CircleCI!
Details
ci/circleci: e2e-cli Your tests passed on CircleCI!
Details
ci/circleci: e2e-cli-ve Your tests passed on CircleCI!
Details
ci/circleci: integration Your tests passed on CircleCI!
Details
ci/circleci: lint Your tests passed on CircleCI!
Details
ci/circleci: setup Your tests passed on CircleCI!
Details
ci/circleci: setup-and-build-win Your tests passed on CircleCI!
Details
ci/circleci: test Your tests passed on CircleCI!
Details
ci/circleci: test-browsers Your tests passed on CircleCI!
Details
ci/circleci: test-win Your tests passed on CircleCI!
Details
ci/circleci: validate Your tests passed on CircleCI!
Details
cla/google All necessary CLAs are signed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

3 participants