mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-23 09:01:08 +03:00
[F] Команда Json*PermissionsHandler - save
This commit is contained in:
parent
248450373a
commit
ebfc7351dd
3 changed files with 26 additions and 1 deletions
|
@ -52,6 +52,19 @@ public void invoke(String... args) throws Exception {
|
|||
}
|
||||
};
|
||||
commands.put("reload", reload);
|
||||
commands.put("save", new SubCommand() {
|
||||
@Override
|
||||
public void invoke(String... args) throws Exception {
|
||||
Path path = Paths.get(filename);
|
||||
if (!IOHelper.exists(path)) {
|
||||
try (Writer writer = IOHelper.newWriter(path)) {
|
||||
Launcher.gsonManager.gson.toJson(map, writer);
|
||||
} catch (IOException e) {
|
||||
LogHelper.error(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
return commands;
|
||||
}
|
||||
|
||||
|
|
|
@ -53,6 +53,19 @@ public void invoke(String... args) throws Exception {
|
|||
}
|
||||
};
|
||||
commands.put("reload", reload);
|
||||
commands.put("save", new SubCommand() {
|
||||
@Override
|
||||
public void invoke(String... args) throws Exception {
|
||||
Path path = Paths.get(filename);
|
||||
if (!IOHelper.exists(path)) {
|
||||
try (Writer writer = IOHelper.newWriter(path)) {
|
||||
Launcher.gsonManager.gson.toJson(map, writer);
|
||||
} catch (IOException e) {
|
||||
LogHelper.error(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
return commands;
|
||||
}
|
||||
|
||||
|
|
|
@ -52,7 +52,6 @@ public void invoke(String... args) throws Exception {
|
|||
commands.put("clearExclude", new SubCommand() {
|
||||
@Override
|
||||
public void invoke(String... args) throws Exception {
|
||||
verifyArgs(args, 1);
|
||||
exclude.clear();
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue