diff Resources/Toolbox.lua @ 1065:921532f67770

Lua scripts can invoke system commands, with CallSystem()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 25 Jul 2014 16:59:33 +0200
parents 160dfe770618
children d710ea64f0fd
line wrap: on
line diff
--- a/Resources/Toolbox.lua	Fri Jul 25 16:13:36 2014 +0200
+++ b/Resources/Toolbox.lua	Fri Jul 25 16:59:33 2014 +0200
@@ -93,5 +93,20 @@
 end
 
 
+function CallSystem(instanceId, command, args)
+   if instanceId == nil then
+      error('Cannot modify a nonexistent instance')
+   end
+
+   table.insert(_job, { 
+                   Operation = 'call-system', 
+                   Instance = instanceId,
+                   Command = command,
+                   Arguments = args
+                })
+
+   return instanceId
+end
+
 
 print('Lua toolbox installed')