Yarh
Yarh

Reputation: 4627

No such file or directory when adding arguments to Gradle exec task

I am making task which runs bash script

task wsUpload(type: Exec) {
  commandLine '../scripts/ws_upload.sh ' + rootProject.ext.VERSION_CODE
}

however it returns

Caused by: java.io.IOException: Cannot run program "../scripts/ws_upload.sh 30" .... No such file or directory

if i ran same command without arguments

 task wsUpload(type: Exec) {
      commandLine '../scripts/ws_upload.sh'
    }

then command is executed. What am i doing wrong?

Upvotes: 1

Views: 899

Answers (1)

LazerBanana
LazerBanana

Reputation: 7221

Add args like this

task wsUpload(type: Exec) {
      commandLine '../scripts/ws_upload.sh'
      args = ["args"]
    }

Upvotes: 1

Related Questions