quick hack for reloading script from disk when script is activated

This commit is contained in:
Fredrik Osterlind 2011-11-01 09:50:15 +01:00
parent d84cf2acb5
commit 370ad52620

View File

@ -272,6 +272,16 @@ public class ScriptRunner extends VisPlugin {
}
public void setScriptActive(boolean active) {
/* Reload script from file */
if (scriptFile != null) {
String script = StringUtils.loadFromFile(scriptFile);
if (script == null) {
logger.fatal("Failed to load script from: " + scriptFile.getAbsolutePath());
} else {
updateScript(script);
}
}
if (active) {
/* Free any resources */
setScriptActive(false);