return new TaskDef<Object, TaskResult<?>>(scriptItem.getScriptName(), new NamedSupplier<Object, TaskResult<?>>(scriptItem.asOneLineDesc(),new SingleTaskSupplier<Object, TaskResult<?>>() {
@Override
public Task<Object, TaskResult<?>> createNewSession(SessionContext $, Task<Object, TaskResult<?>> parent, TaskDef<Object, TaskResult<?>> def) {
scriptItem.assignVariables($);
final Plugin currentPlugin = getPlugin(scriptItem.pluginName);
for (int i = 0; i < directivesLines.size(); i++) {
String line = directivesLines.get(i);
String firstWord = StringUtils.substringBetween(line, ":", " ");
errors.add(new BearParserScriptSupplier.ScriptError(
line,
scriptItem.startsAtIndex + i, "unknown command: " + firstWord));
}
final Task<Object, TaskResult<?>> task;
if (currentPlugin.getShell().multiLine()) {
// shellContext.name = executableLines.get(0);
String script = Joiner.on("\n").join(executableLines);
task = currentPlugin.getShell().interpret(script, $, parent, null);
}else{
throw new UnsupportedOperationException("todo copy from an old version");
}