(
options: EnvironmentCheckOptions = {},
)
| 237 | } |
| 238 | |
| 239 | export async function runEnvironmentChecks( |
| 240 | options: EnvironmentCheckOptions = {}, |
| 241 | ): Promise<EnvironmentCheckResult> { |
| 242 | const outcomes: EnvironmentCheckOutcome[] = []; |
| 243 | |
| 244 | const ffmpeg = checkFFmpeg(); |
| 245 | outcomes.push(ffmpeg); |
| 246 | |
| 247 | const ffprobe = checkFFprobe(); |
| 248 | outcomes.push(ffprobe); |
| 249 | |
| 250 | let browser: BrowserResult | undefined; |
| 251 | if (options.includeBrowser) { |
| 252 | const chrome = await checkChrome(options.browserPath); |
| 253 | outcomes.push(chrome); |
| 254 | if (chrome.ok && chrome.path) { |
| 255 | browser = { |
| 256 | executablePath: chrome.path, |
| 257 | source: options.browserPath ? "env" : "cache", |
| 258 | }; |
| 259 | } |
| 260 | } |
| 261 | |
| 262 | if (options.includeDisk) { |
| 263 | outcomes.push(checkDisk(options.projectDir)); |
| 264 | } |
| 265 | |
| 266 | if (options.includeWindowsUnc) { |
| 267 | const unc = checkWindowsUncPath(options.projectDir); |
| 268 | if (unc) outcomes.push(unc); |
| 269 | } |
| 270 | |
| 271 | return { |
| 272 | outcomes, |
| 273 | ...(ffmpeg.path ? { ffmpegPath: ffmpeg.path } : {}), |
| 274 | ...(ffprobe.path ? { ffprobePath: ffprobe.path } : {}), |
| 275 | ...(browser ? { browser } : {}), |
| 276 | }; |
| 277 | } |
no test coverage detected