@@ -5,7 +5,7 @@ import { tmpdir } from 'os';
55import { randomUUID } from 'crypto' ;
66import { spawn } from 'child_process' ;
77import { log } from './logger.js' ;
8- import { templateVersion } from '../version.js' ;
8+ import { iOSTemplateVersion , macOSTemplateVersion } from '../version.js' ;
99
1010/**
1111 * Template manager for downloading and managing project templates
@@ -22,9 +22,7 @@ export class TemplateManager {
2222 static async getTemplatePath ( platform : 'iOS' | 'macOS' ) : Promise < string > {
2323 // Check for local override
2424 const envVar =
25- platform === 'iOS'
26- ? 'XCODEBUILD_MCP_IOS_TEMPLATE_PATH'
27- : 'XCODEBUILD_MCP_MACOS_TEMPLATE_PATH' ;
25+ platform === 'iOS' ? 'XCODEBUILDMCP_IOS_TEMPLATE_PATH' : 'XCODEBUILDMCP_MACOS_TEMPLATE_PATH' ;
2826
2927 const localPath = process . env [ envVar ] ;
3028 if ( localPath && existsSync ( localPath ) ) {
@@ -46,7 +44,13 @@ export class TemplateManager {
4644 */
4745 private static async downloadTemplate ( platform : 'iOS' | 'macOS' ) : Promise < string > {
4846 const repo = platform === 'iOS' ? this . IOS_TEMPLATE_REPO : this . MACOS_TEMPLATE_REPO ;
49- const version = process . env . XCODEBUILD_MCP_TEMPLATE_VERSION || templateVersion ;
47+ const defaultVersion = platform === 'iOS' ? iOSTemplateVersion : macOSTemplateVersion ;
48+ const envVarName =
49+ platform === 'iOS'
50+ ? 'XCODEBUILD_MCP_IOS_TEMPLATE_VERSION'
51+ : 'XCODEBUILD_MCP_MACOS_TEMPLATE_VERSION' ;
52+ const version =
53+ process . env [ envVarName ] || process . env . XCODEBUILD_MCP_TEMPLATE_VERSION || defaultVersion ;
5054
5155 // Create temp directory for download
5256 const tempDir = join ( tmpdir ( ) , `xcodebuild-mcp-template-${ randomUUID ( ) } ` ) ;
0 commit comments