MCPcopy Create free account
hub / github.com/Noumena-Network/code / assertMinVersion

Function assertMinVersion

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

Source from the content-addressed store, hash-verified

78 * This approach keeps version comparison logic simple while maintaining traceability via the SHA.
79 */
80export async function assertMinVersion(): Promise<void> {
81 if (process.env.NODE_ENV === 'test') {
82 return
83 }
84
85 try {
86 const versionConfig = await getDynamicConfig_BLOCKS_ON_INIT<{
87 minVersion: string
88 }>('ncode_version_config', { minVersion: '0.0.0' })
89
90 if (
91 versionConfig.minVersion &&
92 lt(MACRO.VERSION, versionConfig.minVersion)
93 ) {
94 // biome-ignore lint/suspicious/noConsole:: intentional console output
95 console.error(`
96It looks like your version of Code (${MACRO.VERSION}) needs an update.
97A newer version (${versionConfig.minVersion} or higher) is required to continue.
98
99To update, please run:
100 code update
101
102This will ensure you have access to the latest features and improvements.
103`)
104 gracefulShutdownSync(1)
105 }
106 } catch (error) {
107 logError(error as Error)
108 }
109}
110
111/**
112 * 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