Files
twenty/packages/twenty-cli/src/commands/app-sync.command.ts
T
martmullandGitHub 68882ec483 Merge commands (#14647)
- duplicates between install and deploy commands
- remove list command that call findManyAgents
2025-09-22 16:26:01 +02:00

34 lines
983 B
TypeScript

import chalk from 'chalk';
import { ApiService } from '../services/api.service';
import { resolveAppPath } from '../utils/app-path-resolver';
import { syncApp } from '../utils/app-sync';
export class AppSyncCommand {
private apiService = new ApiService();
async execute(options: { path?: string }): Promise<void> {
try {
const appPath = await resolveAppPath(options.path);
console.log(chalk.blue('🚀 Syncing Twenty Application'));
console.log(chalk.gray(`📁 App Path: ${appPath}`));
console.log('');
const result = await syncApp(appPath, this.apiService);
if (!result.success) {
console.error(chalk.red('❌ Sync failed:'), result.error);
process.exit(1);
}
console.log(chalk.green('✅ Application synced successfully'));
} catch (error) {
console.error(
chalk.red('Sync failed:'),
error instanceof Error ? error.message : error,
);
process.exit(1);
}
}
}