mirror of
https://github.com/tiennm99/ccs.git
synced 2026-07-16 04:18:05 +00:00
fix(cliproxy): address sync review feedback
- Fix auto_sync JSDoc to say (default: true) matching actual default - Add unlink event handler for profile deletion sync - Add debug logging for sync failures in api-command
This commit is contained in:
@@ -130,6 +130,7 @@ export function startAutoSyncWatcher(): void {
|
||||
|
||||
watcherInstance.on('change', onFileChange);
|
||||
watcherInstance.on('add', onFileChange);
|
||||
watcherInstance.on('unlink', onFileChange);
|
||||
|
||||
watcherInstance.on('error', (error) => {
|
||||
log(`Watcher error: ${error.message}`);
|
||||
|
||||
@@ -277,8 +277,13 @@ async function handleCreate(args: string[]): Promise<void> {
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
// Trigger sync to local CLIProxy config (best-effort, ignore result)
|
||||
syncToLocalConfig();
|
||||
// Trigger sync to local CLIProxy config (best-effort)
|
||||
try {
|
||||
syncToLocalConfig();
|
||||
} catch (err) {
|
||||
const message = err instanceof Error ? err.message : 'Unknown error';
|
||||
console.log(`[i] Auto-sync to CLIProxy config skipped: ${message}`);
|
||||
}
|
||||
|
||||
// Display success
|
||||
console.log('');
|
||||
|
||||
@@ -132,7 +132,7 @@ export interface CLIProxyConfig {
|
||||
auth?: CLIProxyAuthConfig;
|
||||
/** Background token refresh worker settings */
|
||||
token_refresh?: TokenRefreshSettings;
|
||||
/** Auto-sync API profiles to local CLIProxy config on settings change (default: false) */
|
||||
/** Auto-sync API profiles to local CLIProxy config on settings change (default: true) */
|
||||
auto_sync?: boolean;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user