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.
Initial script is to git clone the repos
const shell = require('shelljs')
const path = '/home/test/'
shell.cd(path)
shell.exec('git clone https://github.com/test/mic.git')
This is a java script and it does clone the repo. node git.js and it simply clones the repos
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.
var body = response.getResponseBody();
var res = JSON.parse(body);
if (res.flag < 1){
api.setValue("flag", "failed");
}
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.
Any directions is really helpful