Skip to content

Instantly share code, notes, and snippets.

@kellyrob99
Last active Sep 23, 2015
Embed
What would you like to do?
publish all tgz files under the directory this is run to npm
@Grab(group = 'org.codehaus.gpars', module = 'gpars', version = '1.2.1')
import groovyx.gpars.*
def ant = new AntBuilder()
scanner = ant.fileScanner {
fileset(dir: ".") {
include(name: "**/*.tgz")
exclude(name: '**/\\.*/**')
}
}
GParsPool.withPool() {
scanner.eachParallel {
def process = ['npm', 'publish', it.absolutePath].execute()
process.consumeProcessOutput(System.out, System.err)
process.waitForOrKill(20000)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment