Skip to content

Commit 1f4325f

Browse files
pitzcarraldoclaude
andcommitted
fix: address additional PR review feedback
- Add user feedback when `clix setup` is run on already configured project - Fix isUnescapedQuote to correctly handle escaped backslashes (count consecutive backslashes to determine parity) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent f78fa37 commit 1f4325f

2 files changed

Lines changed: 25 additions & 3 deletions

File tree

src/cli.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,17 @@ async function main() {
207207
await firebaseCommand();
208208
break;
209209

210-
case 'setup':
211-
// Setup already handled by first-run hook, just exit cleanly
210+
case 'setup': {
211+
// Check if setup is needed
212+
const { checkFirstRun } = await import('./lib/services/first-run-service');
213+
const status = await checkFirstRun();
214+
if (status.needsSetup) {
215+
await setupCommand();
216+
} else {
217+
console.log('Project already configured. Use `clix login` to reconfigure.');
218+
}
212219
break;
220+
}
213221

214222
case 'ios-setup':
215223
case 'capabilities':

src/lib/config/project-config-manager.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,21 @@ interface CommentParserState {
244244

245245
/** Check if current position is an unescaped quote */
246246
function isUnescapedQuote(content: string, index: number): boolean {
247-
return content[index] === '"' && (index === 0 || content[index - 1] !== '\\');
247+
if (content[index] !== '"') {
248+
return false;
249+
}
250+
if (index === 0) {
251+
return true;
252+
}
253+
// Count consecutive backslashes before the quote
254+
// Even count (including 0) = unescaped quote, odd count = escaped quote
255+
let backslashCount = 0;
256+
let i = index - 1;
257+
while (i >= 0 && content[i] === '\\') {
258+
backslashCount++;
259+
i--;
260+
}
261+
return backslashCount % 2 === 0;
248262
}
249263

250264
/** Process a character in string context */

0 commit comments

Comments
 (0)