Skip to content

Preserve chmod and chown from overwritten file #13

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

Closed
wants to merge 1 commit into from

Conversation

sheerun
Copy link
Contributor

@sheerun sheerun commented Jun 16, 2016

@sheerun sheerun force-pushed the chmod branch 2 times, most recently from 370fc3e to 4cd47bb Compare June 16, 2016 01:25
@sheerun sheerun mentioned this pull request Jun 16, 2016
@sheerun sheerun force-pushed the chmod branch 2 times, most recently from b5b9935 to ceac606 Compare June 16, 2016 01:46
@sheerun
Copy link
Contributor Author

sheerun commented Jun 16, 2016

@jimbojw @sindresorhus @Qix- could you test?

@sindresorhus
Copy link

// @LinusU @nexdrew @jephir

@sindresorhus
Copy link

README.md 100644 → 100755

You probably didn't mean to change this.

@sheerun
Copy link
Contributor Author

sheerun commented Jun 16, 2016

Hmm I need to fix sync version as well

@sheerun sheerun force-pushed the chmod branch 2 times, most recently from 7483412 to 7308b41 Compare June 16, 2016 11:02
@sheerun
Copy link
Contributor Author

sheerun commented Jun 16, 2016

Everything should be ok now. I've also fixed chmod behavior on node 0.8 which was broken before (node 0.8 doesn't support mode for writeFile).

@nexdrew
Copy link

nexdrew commented Jun 16, 2016

I have tested and confirmed that this fixes sindresorhus/update-notifier#76. Nice work @sheerun!

@Qix-
Copy link

Qix- commented Jun 16, 2016

Looks like it worked 💃

@iarna
Copy link
Contributor

iarna commented Jun 23, 2016

Why the sudo testing? We'd very much like to NOT turn sudo on, as it means using Travis' legacy infrastructure.

// Default behavior is to copy it from original file
fs.stat(filename, function (err, stats) {
if (!err && stats && !options.mode) {
options.mode = stats.mode
Copy link
Contributor

@iarna iarna Jun 23, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not comfortable mutating the options object folks pass in. Maybe the mode & chown values should be passed to the callback instead?

@sheerun
Copy link
Contributor Author

sheerun commented Jun 23, 2016

There's no other way of integration testing "chmod" without enabling sudo. Please try to disable it and observe tests fail.

@sheerun
Copy link
Contributor Author

sheerun commented Jun 23, 2016

All fixed

@jimbojw
Copy link

jimbojw commented Jun 27, 2016

Thanks @sheerun!

@sheerun
Copy link
Contributor Author

sheerun commented Jun 27, 2016

I've also fixed option overriding issue in sync version

@jimbojw
Copy link

jimbojw commented Aug 2, 2016

Linked some related bugs to raise visibility.

@sheerun
Copy link
Contributor Author

sheerun commented Aug 2, 2016

@iarna Any plans to merge it?

@iarna
Copy link
Contributor

iarna commented Aug 8, 2016

Yeah, that makes sense, I'll merge this shortly.

@iarna
Copy link
Contributor

iarna commented Aug 18, 2016

Merged as 36f5104 and released in v1.2.0

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

Successfully merging this pull request may close these issues.

6 participants