Closed patinthehat closed 1 year ago
Cool thanks! I left some comments, and I think we should change the flag name to --download-all
.
@zyedidia I've updated the flag name, which is much better than the original choice, thanks for the suggestion. Could you please re-review?
Thanks, I think there are still some changes to be made (see the review comments), and then I'll merge.
@zyedidia I've addressed all of the change requests - would you please re-review at your convenience? Thanks for all of the great suggestions to improve the code. :+1:
Looks good, thanks!
Overview
This PR adds an additional flag,
-D
/--download-all
, which adds new functionality:When specifying the
--download-all
flag, all projects/repositories defined in the configuration file are downloaded in the order they exist within the config file.If this flag is specified, no other parameters are required.
Implementation
This functionality was implemented by using
exec.Command()
to execute the currently running binary (which is aneget
binary) sequentially for each of the configuration-defined repositories, and the output from the process is streamed in real time to the currentstdout
pipe by redirecting theprocess.stderr
to theos.stderr
.This allows a complete implementation of batch downloading with a minimal amount of additional code, as it leverages
eget
functionality itself.Example Usage
Given the following configuration file:
The following output is displayed when running![image](https://user-images.githubusercontent.com/5508707/202898352-db09aa2b-b8d4-47ba-9900-f9a2de5c851f.png)
eget --download-all
:Notes
Original Notes: I'm not 100% sure that
--download-config
is the best name for this flag, so please suggest alternatives if anything comes to mind. I feel that it could be confusing if an end user thinks that the flag means a configuration file will be downloaded.Alternatives could be
--batch-download
,--download-configured
, or something similar. Thoughts?Updated Notes: The flag has been renamed to
--download-all
per suggestion.