Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SBT task to download / fetch a file from a URL

Tags:

sbt

What is a recommended way to write an SBT task that downloads a file from a known URL into a local file?

Older versions of SBT provided IO.download which could be used to download a URL into a local file, but in recent versions (1.2.8) this method is not available and seem to be commented out in the code.

like image 256
thesamet Avatar asked Oct 27 '25 00:10

thesamet


1 Answers

As documented here:

import scala.sys.process._

url("http://...") #> file("somefile") !
like image 138
thesamet Avatar answered Oct 29 '25 19:10

thesamet