Skip to content

Commit

Permalink
Use getScriptOptions instead of duplicated code
Browse files Browse the repository at this point in the history
  • Loading branch information
magicmq committed Aug 24, 2024
1 parent 1a3b400 commit e95c3ca
Showing 1 changed file with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,7 @@ public RunResult loadScript(String name) throws IOException {
public RunResult loadScript(Path path) throws IOException {
if (path != null) {
String fileName = path.getFileName().toString();
ScriptOptions options;
try {
options = new ScriptOptions(fileName);
} catch (InvalidConfigurationException e) {
PySpigot.get().getLogger().log(Level.SEVERE, "Error when initializing script options for script '" + fileName + "', the default values will be used for this script.", e);
options = new ScriptOptions();
}
ScriptOptions options = getScriptOptions(path);
Script script = new Script(path, fileName, options);

return loadScript(script);
Expand Down

0 comments on commit e95c3ca

Please sign in to comment.