fix(cli): improve changelog release handling and TypeScript compatibility
This commit is contained in:
@@ -148,7 +148,8 @@ export class DockerContainer {
|
||||
const result = await this.smartshell.exec(command);
|
||||
return result.exitCode === 0;
|
||||
} catch (error) {
|
||||
logger.log('error', `Failed to run container: ${error.message}`);
|
||||
const errorMessage = error instanceof Error ? error.message : String(error);
|
||||
logger.log('error', `Failed to run container: ${errorMessage}`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -177,7 +178,8 @@ export class DockerContainer {
|
||||
const result = await this.smartshell.exec(`docker logs ${tailFlag} ${containerName}`);
|
||||
return result.stdout;
|
||||
} catch (error) {
|
||||
return `Error getting logs: ${error.message}`;
|
||||
const errorMessage = error instanceof Error ? error.message : String(error);
|
||||
return `Error getting logs: ${errorMessage}`;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -258,4 +260,4 @@ export class DockerContainer {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ export interface IServiceConfig {
|
||||
|
||||
export class ServiceConfiguration {
|
||||
private configPath: string;
|
||||
private config: IServiceConfig;
|
||||
private config!: IServiceConfig;
|
||||
private docker: DockerContainer;
|
||||
|
||||
constructor() {
|
||||
@@ -515,4 +515,4 @@ export class ServiceConfiguration {
|
||||
logger.log('info', ` 📍 S3 Console: ${s3ConsolePort}`);
|
||||
logger.log('info', ` 📍 Elasticsearch: ${esPort}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,13 +61,15 @@ export class ServiceManager {
|
||||
default: ['mongodb', 'minio', 'elasticsearch']
|
||||
});
|
||||
|
||||
this.enabledServices = response.value || ['mongodb', 'minio', 'elasticsearch'];
|
||||
const enabledServices = response.value || ['mongodb', 'minio', 'elasticsearch'];
|
||||
this.enabledServices = enabledServices;
|
||||
|
||||
// Save to .smartconfig.json
|
||||
await this.saveServiceConfiguration(this.enabledServices);
|
||||
await this.saveServiceConfiguration(enabledServices);
|
||||
} else {
|
||||
this.enabledServices = gitzoneConfig.services;
|
||||
logger.log('info', `🔧 Enabled services: ${this.enabledServices.join(', ')}`);
|
||||
const enabledServices = gitzoneConfig.services as string[];
|
||||
this.enabledServices = enabledServices;
|
||||
logger.log('info', `🔧 Enabled services: ${enabledServices.join(', ')}`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -902,10 +904,11 @@ export class ServiceManager {
|
||||
default: currentServices
|
||||
});
|
||||
|
||||
this.enabledServices = response.value || ['mongodb', 'minio', 'elasticsearch'];
|
||||
const enabledServices = response.value || ['mongodb', 'minio', 'elasticsearch'];
|
||||
this.enabledServices = enabledServices;
|
||||
|
||||
// Save to .smartconfig.json
|
||||
await this.saveServiceConfiguration(this.enabledServices);
|
||||
await this.saveServiceConfiguration(enabledServices);
|
||||
|
||||
logger.log('ok', '✅ Service configuration updated');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user