Download previous versions (#20)

* WIP: Start adding downloading pervious versions

* Oops this was in here

* Properly add Download previous Releases.

* Finally fix it.

Co-authored-by: StackZ <47382115+SuperSaiyajinStackZ@users.noreply.github.com>
This commit is contained in:
Pk11
2020-03-20 03:46:09 -05:00
committed by GitHub
parent 95cb91cc5d
commit 23aab6ada9
9 changed files with 281 additions and 25 deletions
+13 -2
View File
@@ -30,7 +30,17 @@
#include "common.hpp"
#define APP_TITLE "Universal-Updater"
#define VERSION_STRING "2.2.1"
#define VERSION_STRING "2.3.0"
// The Release Fetch struct.
struct ReleaseFetch {
std::string Target;
std::string TagName;
std::string ReleaseName;
std::string Created;
std::string Published;
bool PreRelease;
};
enum DownloadError {
DL_ERROR_NONE = 0,
@@ -38,10 +48,11 @@ enum DownloadError {
DL_ERROR_ALLOC,
DL_ERROR_STATUSCODE,
DL_ERROR_GIT,
DL_CANCEL, // No clue if that's needed tho.
};
Result downloadToFile(std::string url, std::string path);
Result downloadFromRelease(std::string url, std::string asset, std::string path, bool includePrereleases);
Result downloadFromRelease(std::string url, std::string asset, std::string path, std::string Message, bool includePrereleases, bool showVersions);
void displayProgressBar();
+1 -1
View File
@@ -53,7 +53,7 @@ namespace ScriptHelper {
int getNum(nlohmann::json json, const std::string &key, const std::string &key2);
// Script Functions.
void downloadRelease(std::string repo, std::string file, std::string output, bool includePrereleases, std::string message);
void downloadRelease(std::string repo, std::string file, std::string output, bool includePrereleases, bool showVersions, std::string message);
void downloadFile(std::string file, std::string output, std::string message);
void removeFile(std::string file, std::string message);