Download: Create files with 0644, support directory structures#278
Merged
kytrinyx merged 2 commits intoexercism:masterfrom Jan 23, 2016
petertseng:downloads
Merged
Download: Create files with 0644, support directory structures#278kytrinyx merged 2 commits intoexercism:masterfrom petertseng:downloads
kytrinyx merged 2 commits intoexercism:masterfrom
petertseng:downloads
Conversation
When downloading a submission with `exercism download`, previously the files would get written with 0755 (u+rwx g+rx o+rx). In discussion in issue #276 we decided we would like the files to be non-executable, as we don't want to encourage the behavior of executing an arbitrary remote file. The user still has the option of either running the file in the appropriate manner for the language or explicitly chmodding if desired. Fixes #276
A recent change to exercism [1] allows it to preserve directory structures in submissions. However, `exercism download` currently cannot handle such submissions. For example, a submission with `dir/file.txt` would attempt to write `dir/file.txt` without `dir` existing, and fail. To fix this, we create any containing directories before writing files. Fixes #277 [1] exercism/exercism@2dc984d
Member
Author
There was a problem hiding this comment.
I don't know about how similar this code is starting to get with https://github.com/exercism/cli/blob/master/user/item.go#L51 - maybe could use some unification? I'm unsure of where I'd put the code though, so I'd take suggestions on that.
Member
There was a problem hiding this comment.
Let's just leave it for now. We can do some refactoring in a second step.
kytrinyx
added a commit
that referenced
this pull request
Jan 23, 2016
Download: Create files with 0644, support directory structures
Member
|
Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes two issues with downloads #276 and #277. More detailed explanations in the corresponding commit messages.