title: how to run shell script from Gradle and wait for it to finish
body: <p>I'm running a shell script from gradle, the issue is that the shell script is running some prerequisites that I need to be run before gradle continues.</p>
  
  <p>I tried the following but seems like gradle is opening another child process for the shell script</p>
  
  <pre><code>sleep.sh
  echo 'hi1'
  sleep 1
  echo 'hi2'
  sleep 10
  echo 'bye'
  
  
  Gradle:
  task hello3(type: Exec) {
  println 'start gradle....'
      commandLine 'sh','sleep.sh'
  println 'end gradle....'
  }
  
  
  
  Result:
  start gradle....
  end gradle....
  :hello3
  hi1
  hi2
  bye
  </code></pre>