Groovy web console

subscribe to the feed Subscribe
to this
site

Fixed

Published 1 month ago by slide
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
def node(String label, Closure c) {
    c.call()
}

def call(String nodeLabel, String filePath, List replacements) {
    node(nodeLabel) {
        println("Replacing strings in file: '" + filePath + "'")
        replacements.each{
             it.each{needle, replacement -> println("Replacing '" + needle + "' with '" + replacement + "'")}
        }
    }
}

call(
    'linux',
    '/tmp/bullshit/',
    [
        [
            needle: 'tits',
            replacement: 'tats',
        ],
        [
            needle: 'beeps',
            replacement: 'boops',
        ],
    ]
)
 
return