Skip to content

Commit e9f811f

Browse files
committed
fix: respect runtime sentry disable and simplify init policy flow
1 parent 3de0ebe commit e9f811f

2 files changed

Lines changed: 6 additions & 8 deletions

File tree

src/cli/commands/init.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ function enforceInstallPolicy(
680680
return { allowedTargets: targets, skippedClients: [] };
681681
}
682682

683-
if (clientFlag === 'claude') {
683+
if (clientFlag === 'claude' || selectionMode === 'interactive') {
684684
return { allowedTargets: targets, skippedClients: [] };
685685
}
686686

@@ -698,9 +698,5 @@ function enforceInstallPolicy(
698698
allowedTargets.push(target);
699699
}
700700

701-
if (clientFlag === 'claude' || selectionMode === 'interactive') {
702-
return { allowedTargets: targets, skippedClients: [] };
703-
}
704-
705701
return { allowedTargets, skippedClients };
706702
}

src/utils/logger.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ function isSentryDisabledFromEnv(): boolean {
2727
);
2828
}
2929

30-
const sentryEnabled = !isSentryDisabledFromEnv();
30+
function isSentryEnabled(): boolean {
31+
return !isSentryDisabledFromEnv();
32+
}
3133

3234
// Log levels in order of severity (lower number = more severe)
3335
const LOG_LEVELS = {
@@ -78,7 +80,7 @@ const require = createRequire(
7880
let cachedSentry: SentryModule | null = null;
7981

8082
function loadSentrySync(): SentryModule | null {
81-
if (!sentryEnabled || isTestEnv()) {
83+
if (!isSentryEnabled() || isTestEnv()) {
8284
return null;
8385
}
8486
if (cachedSentry) {
@@ -237,7 +239,7 @@ export function log(level: string, message: string, context?: LogContext): void
237239
const timestamp = new Date().toISOString();
238240
const logMessage = `[${timestamp}] [${level.toUpperCase()}] ${message}`;
239241

240-
const captureToSentry = sentryEnabled && __shouldCaptureToSentryForTests(context);
242+
const captureToSentry = isSentryEnabled() && __shouldCaptureToSentryForTests(context);
241243

242244
if (captureToSentry) {
243245
withSentry((s) => {

0 commit comments

Comments
 (0)