The nuxeo shell "script" command:is not working as expected
cd nuxeo-shell
./nxshell.sh -h localhost
> help script Command: script - Executes scripts Aliases: s Options: --file [shortcut: -f] A path to the script file to execute |
> script -f scripts/select.groovy "select * from Document" Command failed. javax.script.ScriptException: javax.script.ScriptException: groovy.lang.MissingPropertyException: No such property: ctx for class: Script1 at com.sun.script.groovy.GroovyScriptEngine.eval(GroovyScriptEngine.java:87) at com.sun.script.groovy.GroovyScriptEngine.eval(GroovyScriptEngine.java:75) at org.nuxeo.ecm.shell.commands.ScriptCommand.eval(ScriptCommand.java:78) at org.nuxeo.ecm.shell.commands.ScriptCommand.run(ScriptCommand.java:59) at org.nuxeo.ecm.shell.CommandLineService.runCommand(CommandLineService.java:329) at org.nuxeo.ecm.shell.commands.InteractiveCommand.runCommand(InteractiveCommand.java:137) at org.nuxeo.ecm.shell.commands.InteractiveCommand.processInput(InteractiveCommand.java:117) at org.nuxeo.ecm.shell.commands.InteractiveCommand.run(InteractiveCommand.java:97) at org.nuxeo.ecm.shell.CommandLineService.runCommand(CommandLineService.java:329) at org.nuxeo.ecm.shell.Main.main(Main.java:101) |
the workaround is to put the scripts inside the nuxeo-shell/scripts directory and to invoke the script without the "script" command:
> select * from Document ... |