Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- println ">>> Initialising ${args[0]}"
- def script = new GroovyShell().parse(new File(args[0]))
- Integer.metaClass.loop = {
- int loops = 0
- while (true) {
- def res = it(loops++)
- if (res && loops < delegate) {
- Thread.sleep(res)
- }
- else break
- }
- }
- def emc = new ExpandoMetaClass(Script.class)
- emc.running = true
- emc.loop = {
- int loops = 0
- while (running) {
- def res = it(loops++)
- if (res) {
- Thread.sleep(res)
- }
- else break
- }
- }
- emc.initialize()
- script.metaClass = emc
- script.run()
- println ">>> Running ${script.name}"
- println script.description
- script.script.call()
Add Comment
Please, Sign In to add comment