Skip to content
This repository has been archived by the owner on Dec 18, 2017. It is now read-only.

Make sure lock file and global install project are not readonly #1850

Merged
merged 1 commit into from May 13, 2015

Conversation

victorhurdugaci
Copy link
Contributor

Fixes #1612

cc @davidfowl

@victorhurdugaci
Copy link
Contributor Author

cc @ChengTian

@ChengTian
Copy link
Contributor

:shipit:

// Make sure that if the lock file exists, it is not readonly
if (File.Exists(filePath))
{
FileAttributes attributes = File.GetAttributes(filePath);
Copy link
Member

Choose a reason for hiding this comment

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

Any reason this code is duplicated?

Copy link
Contributor

Choose a reason for hiding this comment

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

👍
(also use var?)

Copy link
Member

Choose a reason for hiding this comment

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

Also can't this fail sometimes? Can it ever fail?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It can fail if you don't have permissions but we should let it fail. Let the callers decide if they want to handle the exception or not. In the two cases in which we use it, we want it to fail because there is nothing we can do if we cannot remove the readonly attribute

@davidfowl
Copy link
Member

:shipit:

@victorhurdugaci victorhurdugaci merged commit 34eaf00 into dev May 13, 2015
@victorhurdugaci victorhurdugaci deleted the victorhu/readonly branch May 13, 2015 19:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dnu pack fails when project.json is readonly.
5 participants