mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-03-23 17:41:28 +01:00
added validation
This commit is contained in:
@@ -114,8 +114,16 @@ public class RubyBundleAuditAnalyzer extends AbstractFileTypeAnalyzer {
|
|||||||
throw new AnalysisException(String.format("%s should have been a directory.", folder.getAbsolutePath()));
|
throw new AnalysisException(String.format("%s should have been a directory.", folder.getAbsolutePath()));
|
||||||
}
|
}
|
||||||
final List<String> args = new ArrayList<String>();
|
final List<String> args = new ArrayList<String>();
|
||||||
final String bundleAuditPath = Settings.getString(Settings.KEYS.ANALYZER_BUNDLE_AUDIT_PATH);
|
String bundleAuditPath = Settings.getString(Settings.KEYS.ANALYZER_BUNDLE_AUDIT_PATH);
|
||||||
args.add(null == bundleAuditPath ? "bundle-audit" : bundleAuditPath);
|
File bundleAudit = null;
|
||||||
|
if (bundleAuditPath != null) {
|
||||||
|
bundleAudit = new File(bundleAuditPath);
|
||||||
|
if (!bundleAudit.isFile()) {
|
||||||
|
LOGGER.warn("Supplied `bundleAudit` path is incorrect: " + bundleAuditPath);
|
||||||
|
bundleAudit = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
args.add(bundleAudit != null && bundleAudit.isFile() ? bundleAudit.getAbsolutePath() : "bundle-audit");
|
||||||
args.add("check");
|
args.add("check");
|
||||||
args.add("--verbose");
|
args.add("--verbose");
|
||||||
final ProcessBuilder builder = new ProcessBuilder(args);
|
final ProcessBuilder builder = new ProcessBuilder(args);
|
||||||
|
|||||||
Reference in New Issue
Block a user