Various improvements to the exported files controller#292
Open
vuntz wants to merge 5 commits intocrowbar:masterfrom
Open
Various improvements to the exported files controller#292vuntz wants to merge 5 commits intocrowbar:masterfrom
vuntz wants to merge 5 commits intocrowbar:masterfrom
Conversation
| #support paths | ||
| get "utils(.:format)", controller: "support", action: "index", as: "utils" | ||
| get "utils/files/:id(.:format)", controller: "support", action: "destroy", constraints: { id: /[^\/]+/ }, as: "utils_files" | ||
| delete "utils/files/:id(.:format)", controller: "support", action: "destroy", constraints: { id: /[^\/]+/ }, as: "utils_files" |
There was a problem hiding this comment.
Metrics/LineLength: Line is too long. 128/100
Member
There was a problem hiding this comment.
does this require some change in the cli?
Contributor
There was a problem hiding this comment.
No, it's not part of the CLI yet.
It's really horrible to put the files in the db directory, so don't do that. Also properly clean up files at the end.
While not strictly needed, it's slightly better in order to avoid non-crowbar owned files in the rails app tmp directory. We use a chown at the end, of course, but if the rails app is stopped in the middle, then the tmp directory contains files that can't be removed. Using a proper temporary directory helps (since it may be cleaned up on reboot, or by scripts).
They were probably used a long time ago...
This is the same as the title of the page.
Member
|
+1 |
| exports = Dir.glob(Rails.root.join("db", "*.json").to_s) | ||
| cmd = ["tar", "-czf", Rails.root.join("tmp", filename).to_s, *exports] | ||
| tmpdir = Dir.mktmpdir | ||
| tmpdirpath = Pathname.new(tmpdir) |
Member
There was a problem hiding this comment.
MINOR: i would call it tmpdir_path for consistency
or as an alternative just use tmpdir = Dir.mktmpdir(Pathname.new(tmpdir)) and reference it with .to_s where needed
Member
|
just unsure about the cli part (don't know if we even offer it) +1 |
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.
No description provided.