Search in sources :

Example 1 with NpmNodeModulesNotFoundDetectableResult

use of com.synopsys.integration.detectable.detectable.result.NpmNodeModulesNotFoundDetectableResult in project synopsys-detect by blackducksoftware.

the class NpmCliDetectable method extractable.

@Override
public DetectableResult extractable() throws DetectableException {
    File nodeModules = fileFinder.findFile(environment.getDirectory(), NODE_MODULES);
    if (nodeModules == null) {
        return new NpmNodeModulesNotFoundDetectableResult(environment.getDirectory().getAbsolutePath());
    }
    Requirements requirements = new Requirements(fileFinder, environment);
    requirements.explainDirectory(nodeModules);
    npmExe = requirements.executable(() -> npmResolver.resolveNpm(environment), "npm");
    return requirements.result();
}
Also used : NpmNodeModulesNotFoundDetectableResult(com.synopsys.integration.detectable.detectable.result.NpmNodeModulesNotFoundDetectableResult) File(java.io.File) Requirements(com.synopsys.integration.detectable.detectable.Requirements)

Aggregations

Requirements (com.synopsys.integration.detectable.detectable.Requirements)1 NpmNodeModulesNotFoundDetectableResult (com.synopsys.integration.detectable.detectable.result.NpmNodeModulesNotFoundDetectableResult)1 File (java.io.File)1