Merge pull request #1292 from FieryRobot/ScriptDownloadFix

Always reset the app store root in the validator (#1275).
This commit is contained in:
gnembon authored and GitHub committed 2022-01-29 23:11:45 +01:00
commit 82bdd5e61c
1 file changed
+2 -3
@@ -47,7 +47,7 @@ public class AppStoreManager
/** A local copy of the scarpet repo's file structure, to avoid multiple queries to github.com while typing out the /** A local copy of the scarpet repo's file structure, to avoid multiple queries to github.com while typing out the
* {@code /script download} command and getting the suggestions. * {@code /script download} command and getting the suggestions.
*/ */
public static final StoreNode APP_STORE_ROOT = StoreNode.folder(null, ""); private static StoreNode APP_STORE_ROOT = StoreNode.folder(null, "");
/** This is the base link to the scarpet app repo from the github api. /** This is the base link to the scarpet app repo from the github api.
*/ */
@@ -59,8 +59,7 @@ public class AppStoreManager
{ {
@Override public String validate(CommandSourceStack source, ParsedRule<String> currentRule, String newValue, String string) @Override public String validate(CommandSourceStack source, ParsedRule<String> currentRule, String newValue, String string)
{ {
APP_STORE_ROOT.sealed = false; APP_STORE_ROOT = StoreNode.folder(null, "");
APP_STORE_ROOT.children = new HashMap<>();
if (newValue.equalsIgnoreCase("none")) if (newValue.equalsIgnoreCase("none"))
{ {
scarpetRepoLink = null; scarpetRepoLink = null;