index.js
function condor_simple(cmd, opts) {
    var deferred = Q.defer();
    var p = spawn(cmd, opts, {env: get_condor_env()});//, {cwd: __dirname});

    //load event
    var stdout = "";
    p.stdout.on('data', function (data) {
        stdout += data;
    });
    var stderr = "";
    p.stderr.on('data', function (data) {
        stderr += data;
    });
    p.on('error', deferred.reject);
    p.on('close', function (code, signal) {
        if (signal) {
            deferred.reject(cmd+ " was killed by signal "+ signal);
        } else if (code !== 0) {
            deferred.reject(cmd+ " failed with exit code "+ code+ "\nSTDERR:"+ stderr + "\nSTDOUT:"+ stdout);
        } else {
            deferred.resolve(stdout, stderr);
        }
    });
    return deferred.promise;
}
function condor_simple(cmd, opts) {
    var deferred = Q.defer();
    var p = spawn(cmd, opts, {env: get_condor_env()});//, {cwd: __dirname});

    //load event
    var stdout = "";
    p.stdout.on('data', function (data) {
        stdout += data;
    });
    var stderr = "";
    p.stderr.on('data', function (data) {
        stderr += data;
    });
    p.on('error', deferred.reject);
    p.on('close', function (code, signal) {
        if (signal) {
            deferred.reject(cmd+ " was killed by signal "+ signal);
        } else if (code !== 0) {
            deferred.reject(cmd+ " failed with exit code "+ code+ "\nSTDERR:"+ stderr + "\nSTDOUT:"+ stdout);
        } else {
            deferred.resolve(stdout, stderr);
        }
    });
    return deferred.promise;
}
function condor_simple ( cmd , opts ) { var deferred = Q . defer ( ) ; var p = spawn ( cmd , opts , { env : get_condor_env ( ) } ) ; //, {cwd: __dirname}); //load event var stdout = "" ; p . stdout . on ( 'data' , function ( data ) { stdout += data ; } ) ; var stderr = "" ; p . stderr . on ( 'data' , function ( data ) { stderr += data ; } ) ; p . on ( 'error' , deferred . reject ) ; p . on ( 'close' , function ( code , signal ) { if ( signal ) { deferred . reject ( cmd + " was killed by signal " + signal ) ; } else if ( code !== 0 ) { deferred . reject ( cmd + " failed with exit code " + code + "\nSTDERR:" + stderr + "\nSTDOUT:" + stdout ) ; } else { deferred . resolve ( stdout , stderr ) ; } } ) ; return deferred . promise ; }
run simple condor command that takes job id as an argument
run simple condor command that takes job id as an argument