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

this.fs.append triggers a conflict resolution #1239

Closed
drewdaemon opened this issue May 12, 2020 · 4 comments
Closed

this.fs.append triggers a conflict resolution #1239

drewdaemon opened this issue May 12, 2020 · 4 comments
Labels
needs triage Awaiting triage

Comments

@drewdaemon
Copy link

When my generator uses mem-fs-editor's append function, it triggers a conflict with the existing file that is to be appended to. It would be nice if that didn't happen as it's simply appending. Either the conflicter could be smarter, or there could be a way to flag a particular file as a force target without turning on force for everything.

@drewdaemon drewdaemon added the needs triage Awaiting triage label May 12, 2020
@mshima
Copy link
Member

mshima commented May 12, 2020

This is the expected behaviour.

To force override this should work:
this.env.sharedFs.get(this.destinationPath('foo.bar')).conflicter = 'force';

@mshima mshima closed this as completed May 12, 2020
@mshima
Copy link
Member

mshima commented May 12, 2020

I think the api doesn't guarantee the instance returned is the same, so better do:

const file = this.env.sharedFs.get(this.destinationPath('foo.bar'));
file.conflicter = 'force';
this.env.sharedFs.add(file);

And better replay every time the file is written.

@drewdaemon
Copy link
Author

That seems a little esoteric, but it did solve my problem. Thanks for the quick response @mshima.

@mshima
Copy link
Member

mshima commented May 13, 2020

This is not a common feature.
Otherwise we could add a shortcut.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Awaiting triage
Projects
None yet
Development

No branches or pull requests

2 participants