(ui_dir: &Path)
| 116 | } |
| 117 | |
| 118 | fn should_run_npm_ci(ui_dir: &Path) -> Result<bool, Box<dyn std::error::Error>> { |
| 119 | let package_json = ui_dir.join("package.json"); |
| 120 | let package_lock = ui_dir.join("package-lock.json"); |
| 121 | let marker = ui_dir.join("node_modules/.package-lock.json"); |
| 122 | |
| 123 | if !marker.exists() { |
| 124 | return Ok(true); |
| 125 | } |
| 126 | |
| 127 | let marker_time = modified_time(&marker)?; |
| 128 | Ok(modified_time(&package_json)? > marker_time || modified_time(&package_lock)? > marker_time) |
| 129 | } |
| 130 | |
| 131 | fn modified_time(path: &Path) -> Result<SystemTime, Box<dyn std::error::Error>> { |
| 132 | Ok(fs::metadata(path)?.modified()?) |
no test coverage detected