vladshcherbin / rollup-plugin-copy

Copy files and folders using Rollup

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use another user group instead of root

MonFig opened this issue · comments

I found out that the copied file was created by root instead of my current user group, and that causes I can not delete the file with out sudo.

code:

        copy({
            targets: [{src: 'build/static/god/template.html', dest: 'build/test', rename: 'index.html'}],
        })

and when I want to remove the files I got:

Failed to compile.

EACCES: permission denied, unlink '/Users/monkeyfigaro/workspace/sohu-inc/awesome-sohu/build/test/index.html'


error Command failed with exit code 1.

See the user groups:

image

@MonFig hey, this looks strange.

I've tried it in a a fresh test project and it gives me my user group.

image

I've also tried to set template.html file group to root and copy after, but it also changed group to my current user one.

What's your OS, maybe you can link me your test repo since I don't know how to recreate this error in mine?

Maybe you can also try bare copy function from fs-extra package.

It's used inside this package to copy stuff and I believe actual issue is there. It would be great to test if it copies with the same result. If yes, it will confirm that issue is in this function and we can open an issue in fs-extra package.

It's strange that I can not recreate this issue either, which could be steadily repeated a few hours ago. I would close this issue until I find out how to repeat it.

You might've installed npm with sudo, and now running npm run script-that-uses-rollup is ran under root? Just a thought.