use super::javascript::RuntimeDetectionResult;
use std::path::Path;
pub struct RuntimeDetectionEngine;
impl RuntimeDetectionEngine {
pub fn detect_primary_runtime(project_path: &Path) -> RuntimeDetectionResult {
use super::javascript::RuntimeDetector;
let js_detector = RuntimeDetector::new(project_path.to_path_buf());
js_detector.detect_js_runtime_and_package_manager()
}
pub fn get_all_package_managers(project_path: &Path) -> Vec<super::javascript::PackageManager> {
use super::javascript::RuntimeDetector;
let js_detector = RuntimeDetector::new(project_path.to_path_buf());
js_detector.detect_all_package_managers()
}
pub fn uses_runtime(project_path: &Path, runtime: &str) -> bool {
let detection = Self::detect_primary_runtime(project_path);
detection.runtime.as_str() == runtime
}
}