MCPcopy Index your code
hub / github.com/getsentry/XcodeBuildMCP / doesMakeLogFileExist

Function doesMakeLogFileExist

src/utils/xcodemake.ts:128–160  ·  view source on GitHub ↗
(projectDir: string, command: string[])

Source from the content-addressed store, hash-verified

126}
127
128export function doesMakeLogFileExist(projectDir: string, command: string[]): boolean {
129 const originalDir = process.cwd();
130
131 try {
132 process.chdir(projectDir);
133
134 const xcodemakeCommand = ['xcodemake', ...command.slice(1)];
135 const escapedCommand = xcodemakeCommand.map((arg) => {
136 // Remove projectDir from arguments if present at the start
137 const prefix = projectDir + '/';
138 if (arg.startsWith(prefix)) {
139 return arg.substring(prefix.length);
140 }
141 return arg;
142 });
143 const commandString = escapedCommand.join(' ');
144 const logFileName = `${commandString}.log`;
145 log('debug', `Checking for Makefile log: ${logFileName} in directory: ${process.cwd()}`);
146
147 const files = readdirSync('.');
148 const exists = files.includes(logFileName);
149 log('debug', `Makefile log ${exists ? 'exists' : 'does not exist'}: ${logFileName}`);
150 return exists;
151 } catch (error) {
152 log(
153 'error',
154 `Error checking for Makefile log: ${error instanceof Error ? error.message : String(error)}`,
155 );
156 return false;
157 } finally {
158 process.chdir(originalDir);
159 }
160}
161
162export async function executeXcodemakeCommand(
163 projectDir: string,

Callers 1

executeXcodeBuildCommandFunction · 0.90

Calls 1

logFunction · 0.90

Tested by

no test coverage detected