title: Integrate Javascript with response
body: <p>I have two Java scripts and i would like to merge them to get a output that can be treated as successful or failure. I'm not sure if this is the right direction or if i have got this completely wrong.</p>
  <p>Initial script is to git clone the repos</p>
  <pre><code>const shell = require('shelljs')
  const path = '/home/test/'
  shell.cd(path)
  shell.exec('git clone https://github.com/test/mic.git')
  
  </code></pre>
  <p>This is a java script and it does clone the repo.
  node git.js and it simply clones the repos</p>
  <p>Now I have another script which needs to get the result of the above script and pass it to a variable which then says if it is success of failure.</p>
  <pre><code>var body = response.getResponseBody();
  var res = JSON.parse(body);
  
  if (res.flag &lt; 1){
      api.setValue(&quot;flag&quot;, &quot;failed&quot;);
  }
  
  </code></pre>
  <p>Is there a way to integrate these scripts to get the right results.
  All i want is if the first script will success/fail and get the status as a result which can be passed as a flag to another variable.</p>
  <p>Any directions is really helpful</p>