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

Binary files copied incorrectly using copyTpl. #1062

Closed
Lighttree opened this issue Mar 7, 2018 · 2 comments
Closed

Binary files copied incorrectly using copyTpl. #1062

Lighttree opened this issue Mar 7, 2018 · 2 comments

Comments

@Lighttree
Copy link

Lighttree commented Mar 7, 2018

In case your template folder contains binary file (I was working with .png) these files might be corrupted at destination. For example .pngs fail generation at all or copied as empty files.

writing() {
    this.fs.copyTpl(
        this.templatePath(),
        this.destinationPath(),
        this.props
    );
}

I think the problem is in old version of mem-fs-editor used:
https://github.com/yeoman/generator/blob/master/package.json#L51

this implementation runs ejs compiler over binary files and fails there since it might find something that looks like <% (ejs template syntax).

This seems to be fixed in latest version of mem-fs-editor since they added isBinary check:
https://github.com/SBoudrias/mem-fs-editor/blob/master/lib/actions/copy-tpl.js#L9

@github-actions
Copy link
Contributor

This issue is stale because it has been open 15 days with no activity. Remove stale label or comment or this will be closed in 5 days

@koppor
Copy link

koppor commented May 7, 2020

Still happens with 4.9.0. In my concrete case, I could swtich to copy as there was no need to modify the binary file.

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

No branches or pull requests

3 participants