MCPcopy Index your code
hub / github.com/liuup/claude-code-analysis / assertMinVersion

Function assertMinVersion

src/utils/autoUpdater.ts:70–99  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

68 * This approach keeps version comparison logic simple while maintaining traceability via the SHA.
69 */
70export async function assertMinVersion(): Promise<void> {
71 if (process.env.NODE_ENV === 'test') {
72 return
73 }
74
75 try {
76 const versionConfig = await getDynamicConfig_BLOCKS_ON_INIT<{
77 minVersion: string
78 }>('tengu_version_config', { minVersion: '0.0.0' })
79
80 if (
81 versionConfig.minVersion &&
82 lt(MACRO.VERSION, versionConfig.minVersion)
83 ) {
84 // biome-ignore lint/suspicious/noConsole:: intentional console output
85 console.error(`
86It looks like your version of Claude Code (${MACRO.VERSION}) needs an update.
87A newer version (${versionConfig.minVersion} or higher) is required to continue.
88
89To update, please run:
90 claude update
91
92This will ensure you have access to the latest features and improvements.
93`)
94 gracefulShutdownSync(1)
95 }
96 } catch (error) {
97 logError(error as Error)
98 }
99}
100
101/**
102 * Returns the maximum allowed version for the current user type.

Callers 1

runFunction · 0.85

Calls 4

ltFunction · 0.85
gracefulShutdownSyncFunction · 0.85
logErrorFunction · 0.70
errorMethod · 0.45

Tested by

no test coverage detected