Begin to add checks for Scripts.

This commit is contained in:
StackZ
2020-03-21 03:49:21 +01:00
parent 23aab6ada9
commit 73c495db4f
7 changed files with 307 additions and 234 deletions
+1 -1
View File
@@ -51,7 +51,7 @@ private:
nlohmann::json openScriptFile();
void checkForValidate(void);
void loadDesc(void);
void runFunctions(nlohmann::json &json);
Result runFunctions(nlohmann::json &json);
// Draw Functions.
void DrawSubMenu(void) const;
+1 -1
View File
@@ -62,7 +62,7 @@ private:
void GitHubLogic(u32 hDown, u32 hHeld, touchPosition touch);
void execute();
Result execute();
void descript();
void updateStore(int selectedStore);
void deleteStore(int selectedStore);
+11 -2
View File
@@ -47,14 +47,21 @@ struct StoreInfo {
std::string sheetURL;
};
enum ScriptState {
NONE = 0,
FAILED_DOWNLOAD,
SCRIPT_CANCELED,
SYNTAX_ERROR,
};
namespace ScriptHelper {
// Get stuff from a JSON.
std::string getString(nlohmann::json json, const std::string &key, const std::string &key2);
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, bool showVersions, std::string message);
void downloadFile(std::string file, std::string output, std::string message);
Result downloadRelease(std::string repo, std::string file, std::string output, bool includePrereleases, bool showVersions, std::string message);
Result downloadFile(std::string file, std::string output, std::string message);
void removeFile(std::string file, std::string message);
void installFile(std::string file, std::string message);
@@ -66,6 +73,8 @@ namespace ScriptHelper {
void deleteTitle(const std::string TitleID, bool isNAND, std::string message);
void bootTitle(const std::string TitleID, bool isNAND, std::string message);
Result prompt(std::string message);
}
#endif