(filePath: string)
| 498 | * Only use for checking system tool installation paths. |
| 499 | */ |
| 500 | export async function systemPathAccess(filePath: string): Promise<boolean> { |
| 501 | if (!isAllowedSystemPath(filePath)) { |
| 502 | throw new Error(`[SystemPaths] Access denied: ${filePath} is not an allowed system path`); |
| 503 | } |
| 504 | try { |
| 505 | await fs.access(filePath); |
| 506 | return true; |
| 507 | } catch { |
| 508 | return false; |
| 509 | } |
| 510 | } |
| 511 | |
| 512 | /** |
| 513 | * Check if a file has execute permission (synchronous) |
no test coverage detected