I am trying to iterate through a list of urls and ...
# community-support
a
I am trying to iterate through a list of urls and download the dependencies with curl vai exec method. However, only the first file(in the url list) gets downloaded. Below is what I am trying to do :
Copy code
task downloadDeps {
    doLast {
        def libDir = file("${buildDir}/lib")
        if (!libDir.exists()) {
            libDir.mkdirs()
        }

        dependencyList.each { dep ->
            println "Downloading from: ${dep}"
            exec {
                workingDir libDir
                commandLine 'curl', '-f', '-#', '-OJ', "${dep}"
            }
        }
    }
}
What mistake am I doing here?