build/wh-client.js
function fStdout_fSterr_Check(workDir) {
    let emitterCheck = new EventEmitter();
    let splitWorkDir = workDir.split('/');
    let nameOut = path.basename(workDir) + ".out";
    let nameErr = path.basename(workDir) + ".err";
    let pathOut = workDir + "/" + nameOut;
    let pathErr = workDir + "/" + nameErr;
    pathExists(pathOut).then(existsOut => {
        if (existsOut) {
            pathExists(pathErr).then(existsErr => {
                if (existsErr) {
                    emitterCheck.emit('checkOK', nameOut, nameErr);
                }
                else
                    emitterCheck.emit('checkNotOK');
            })
                .catch(err => {
                emitterCheck.emit('checkNotOK');
            });
        }
        else
            emitterCheck.emit('checkNotOK');
    })
        .catch(err => {
        emitterCheck.emit('checkNotOK');
    });
    return emitterCheck;
}
function fStdout_fSterr_Check(workDir) {
    let emitterCheck = new EventEmitter();
    let splitWorkDir = workDir.split('/');
    let nameOut = path.basename(workDir) + ".out";
    let nameErr = path.basename(workDir) + ".err";
    let pathOut = workDir + "/" + nameOut;
    let pathErr = workDir + "/" + nameErr;
    pathExists(pathOut).then(existsOut => {
        if (existsOut) {
            pathExists(pathErr).then(existsErr => {
                if (existsErr) {
                    emitterCheck.emit('checkOK', nameOut, nameErr);
                }
                else
                    emitterCheck.emit('checkNotOK');
            })
                .catch(err => {
                emitterCheck.emit('checkNotOK');
            });
        }
        else
            emitterCheck.emit('checkNotOK');
    })
        .catch(err => {
        emitterCheck.emit('checkNotOK');
    });
    return emitterCheck;
}
function fStdout_fSterr_Check ( workDir ) { let emitterCheck = new EventEmitter ( ) ; let splitWorkDir = workDir . split ( '/' ) ; let nameOut = path . basename ( workDir ) + ".out" ; let nameErr = path . basename ( workDir ) + ".err" ; let pathOut = workDir + "/" + nameOut ; let pathErr = workDir + "/" + nameErr ; pathExists ( pathOut ) . then ( existsOut => { if ( existsOut ) { pathExists ( pathErr ) . then ( existsErr => { if ( existsErr ) { emitterCheck . emit ( 'checkOK' , nameOut , nameErr ) ; } else emitterCheck . emit ( 'checkNotOK' ) ; } ) . catch ( err => { emitterCheck . emit ( 'checkNotOK' ) ; } ) ; } else emitterCheck . emit ( 'checkNotOK' ) ; } ) . catch ( err => { emitterCheck . emit ( 'checkNotOK' ) ; } ) ; return emitterCheck ; }
function fStdout_fSterr_Check require a workDir. This function will first extract the repositery of a job with a split.addJob. And then construct two file path (output file et error file) Next we use the path-exists package which allows us to check if those two file path exist in the file system. If both are found in the file system we emit the event 'checkOK', and we can returned them to the jobmanager micro-service. The path-exists package use the fs access method to return a boolean, with promises in asynchronous way. path.basename extract th end of a path, use there to extract the name of the repository that contain output file and error file.
function fStdout_fSterr_Check require a workDir . This function will first extract the repositery of a job with a split . addJob . And then construct two file path ( output file et error file ) Next we use the path - exists package which allows us to check if those two file path exist in the file system . If both are found in the file system we emit the event checkOK and we can returned them to the jobmanager micro - service . The path - exists package use the fs access method to return a boolean with promises in asynchronous way . path . basename extract th end of a path use there to extract the name of the repository that contain output file and error file .