Switch default remote to lastly added remote (#19697)

as title
This commit is contained in:
martmull
2026-04-14 18:03:05 +02:00
committed by GitHub
parent 9cf6f42313
commit 3463ee5dc4

View File

@@ -94,6 +94,9 @@ export const registerRemoteCommands = (program: Command): void => {
ConfigService.setActiveRemote(options.as);
await authenticate(config.apiUrl, options.apiKey);
await configService.setDefaultRemote(options.as);
console.log(chalk.green(`✓ Default remote set to "${options.as}".`));
return;
}
@@ -142,11 +145,8 @@ export const registerRemoteCommands = (program: Command): void => {
ConfigService.setActiveRemote(name);
await authenticate(apiUrl, options.apiKey);
const defaultRemote = await configService.getDefaultRemote();
if (defaultRemote === 'local') {
await configService.setDefaultRemote(name);
}
await configService.setDefaultRemote(name);
console.log(chalk.green(`✓ Default remote set to "${name}".`));
},
);