-
-
Notifications
You must be signed in to change notification settings - Fork 361
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
nextercism: implement download command #411
Comments
This was referenced Aug 4, 2017
13 tasks
I have a kind of gross implementation of this locally that I'm going to clean up and submit. |
Yepp—there are a number of small fixes we need, but I'll triage them and open separate issues. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To be merged into the nextercism branch in #410
Command name:
download
(aliasd
).File:
cmd/download.go
.Track is inferred
By default, you download by specifying the slug of the exercise. E.g.:
The track can almost always be inferred based on context. Most people only work on one track. At other times we can determine the track based on the current location on the file system. If we are unable to identify a track, we will submit the request without one, and the API will respond with a list of possible tracks where this exercise is available to the user.
People can specify the
--track
flag (shortflag:t
) to explicitly disambiguate.Selective overwrite
If download an exercise and there are already files there, we will interactively ask whether or not the CLI should overwrite the file (each file individually). We'll show a diff to help make the decision.
If you run the download command with
--force
(or-f
), it will automatically overwrite any existing files. There will also be a user setting so you can set force as default.Downloading other people's solutions
You can download someone else's solution to something given a valid UUID, or the URL to their solution.
This downloads it to a separate directory tree (TBD). E.g.
The separate directory tree is important, because we need to make it very easy for people to submit their exercises to version control, without accidentally storing (and exposing) other people's solutions.
We will be storing metadata about the solution in a hidden file locally, and the
open
command can be used with the path to an exercise (yours or someone else's) to make it easy to open it in the browser.If you download multiple iterations of the same exercise, then they will be added to separate directories, with a serial, numeric suffix. This number is only for the user to disambiguate, and does not have anything to do with the actual iteration number on the site.
API Payload
[maybe] Download all available
For the beta launch we will not be implementing a flag that lets you download all available exercises, but we will consider it for a future version.
If there is a huge need for downloading all exercises in a track (e.g. so that you can do Exercism exercises while on a long trip), then we will consider how to make that possible. It probably won't be built into the CLI, though.
[maybe] Download all solved
For the beta launch we will not be implementing behavior to let you download everything you've done on a track all at once, but we will consider it for a future version.
The text was updated successfully, but these errors were encountered: