Here is the code curl to download file in github private repo
def command = "curl -s -O https://[email protected]/myGitHubAccount/myrepo/master/app/src/main/res/values/colors.xml"
task myCurlTask(){
command.execute()
When I execute it the output file place in my root project directory. I want to execute it and put the file in my res/values folder of my android project.
How can I do that? And How to write that code in gradle.kts?
Finally I found
tasks.register("downloadColorsFromPrivateRepo") {
val destinationPath = "${project.projectDir}/src/main/res/values/colors.xml"
val githubPrivateRepoToken = "myToken"
val command = "curl -o $destinationPath https://${githubPrivateRepoToken}@raw.githubusercontent.com/myGitHubAccount/myrepo/master/app/src/main/res/values/colors.xml"
Runtime.getRuntime().exec(command)
}