From a07f57e698107056d045d8d5c2458e04c809fcc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?W=C3=ADtallo?= <15958770+witalloliveira@users.noreply.github.com> Date: Thu, 31 Oct 2024 06:19:07 -0300 Subject: [PATCH] feat(cli): opts.instance as instace name and prefix (#4609) --- cli/instance.ts | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/cli/instance.ts b/cli/instance.ts index 3e21bc72e4..9f3a8bd025 100644 --- a/cli/instance.ts +++ b/cli/instance.ts @@ -190,6 +190,21 @@ export async function pickInstance( allowNew: boolean ) { const instances = await allInstances(); + if (opts.baseUrl && opts.token && opts.instance) { + log.info("Using instance defined by --instance, --base-url and --token"); + + setClient( + opts.token, + opts.baseUrl.endsWith("/") ? opts.baseUrl.slice(0, -1) : opts.baseUrl + ); + + return { + name: opts.instance, + remote: opts.baseUrl, + token: opts.token, + prefix: opts.instance, + }; + } if (opts.baseUrl && opts.token) { log.info("Using instance fully defined by --base-url and --token"); @@ -687,7 +702,7 @@ const command = new Command() .option("--folder-per-instance", "Create a folder per instance") .option( "--instance ", - "Name of the instance to push to, override the active instance" + "Name of the instance to pull from, override the active instance" ) .action(instancePull as any) .command("push")