()
| 86 | } |
| 87 | |
| 88 | export async function isXcodemakeAvailable(): Promise<boolean> { |
| 89 | if (!isXcodemakeEnabled()) { |
| 90 | log('debug', 'xcodemake is not enabled, skipping availability check'); |
| 91 | return false; |
| 92 | } |
| 93 | |
| 94 | try { |
| 95 | if (overriddenXcodemakePath && existsSync(overriddenXcodemakePath)) { |
| 96 | log('debug', `xcodemake found at overridden path: ${overriddenXcodemakePath}`); |
| 97 | return true; |
| 98 | } |
| 99 | |
| 100 | const result = await getDefaultCommandExecutor()(['which', 'xcodemake']); |
| 101 | if (result.success) { |
| 102 | log('debug', 'xcodemake found in PATH'); |
| 103 | return true; |
| 104 | } |
| 105 | |
| 106 | log('info', 'xcodemake not found in PATH, attempting to download...'); |
| 107 | const installed = await installXcodemake(); |
| 108 | if (!installed) { |
| 109 | log('warn', 'xcodemake installation failed'); |
| 110 | return false; |
| 111 | } |
| 112 | |
| 113 | log('info', 'xcodemake installed successfully'); |
| 114 | return true; |
| 115 | } catch (error) { |
| 116 | log( |
| 117 | 'error', |
| 118 | `Error checking for xcodemake: ${error instanceof Error ? error.message : String(error)}`, |
| 119 | ); |
| 120 | return false; |
| 121 | } |
| 122 | } |
| 123 | |
| 124 | export function doesMakefileExist(projectDir: string): boolean { |
| 125 | return existsSync(`${projectDir}/Makefile`); |
no test coverage detected