From d56f19f9c379985c89137d99d5a3fa51f869f412 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Sat, 11 Aug 2012 12:23:30 +0000 Subject: [PATCH] * fix -script g:code URI encoding problems --- source/net/sourceforge/filebot/cli/ArgumentProcessor.java | 2 +- source/net/sourceforge/filebot/cli/ScriptShell.java | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/source/net/sourceforge/filebot/cli/ArgumentProcessor.java b/source/net/sourceforge/filebot/cli/ArgumentProcessor.java index 2b5af288..54fccab0 100644 --- a/source/net/sourceforge/filebot/cli/ArgumentProcessor.java +++ b/source/net/sourceforge/filebot/cli/ArgumentProcessor.java @@ -128,7 +128,7 @@ public class ArgumentProcessor { Analytics.trackEvent("CLI", "ExecuteScript", script.getScheme()); ScriptShell shell = new ScriptShell(cli, args, AccessController.getContext(), scriptProvider); - shell.runScript(script.toString(), bindings); + shell.runScript(script, bindings); } CLILogger.finest("Done ヾ(@⌒ー⌒@)ノ"); diff --git a/source/net/sourceforge/filebot/cli/ScriptShell.java b/source/net/sourceforge/filebot/cli/ScriptShell.java index 8b43ed7d..d03c4ee2 100644 --- a/source/net/sourceforge/filebot/cli/ScriptShell.java +++ b/source/net/sourceforge/filebot/cli/ScriptShell.java @@ -83,9 +83,12 @@ class ScriptShell { public Object runScript(String input, Bindings bindings) throws Throwable { - URI resource = scriptProvider.getScriptLocation(input); + return runScript(scriptProvider.getScriptLocation(input), bindings); + } + + + public Object runScript(URI resource, Bindings bindings) throws Throwable { Script script = scriptProvider.fetchScript(resource); - return evaluate(script.code, bindings, script.trusted); }