mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-20 08:01:35 +00:00
fix(cli): improve --instance handling wmill instance push
This commit is contained in:
+14
-4
@@ -183,6 +183,7 @@ export type InstanceSyncOptions = {
|
||||
token?: string;
|
||||
folderPerInstance?: boolean;
|
||||
yes?: boolean;
|
||||
prefix?: string;
|
||||
};
|
||||
|
||||
export async function pickInstance(
|
||||
@@ -202,7 +203,7 @@ export async function pickInstance(
|
||||
name: opts.instance,
|
||||
remote: opts.baseUrl,
|
||||
token: opts.token,
|
||||
prefix: opts.instance,
|
||||
prefix: opts.prefix ?? opts.instance,
|
||||
};
|
||||
}
|
||||
if (opts.baseUrl && opts.token) {
|
||||
@@ -217,7 +218,7 @@ export async function pickInstance(
|
||||
name: "custom",
|
||||
remote: opts.baseUrl,
|
||||
token: opts.token,
|
||||
prefix: "custom",
|
||||
prefix: opts.prefix ?? "custom",
|
||||
};
|
||||
}
|
||||
if (!allowNew && instances.length < 1) {
|
||||
@@ -448,8 +449,8 @@ async function instancePush(opts: GlobalOptions & InstanceSyncOptions) {
|
||||
const rootDir = Deno.cwd();
|
||||
|
||||
let localPrefix;
|
||||
if (opts.baseUrl && opts.token) {
|
||||
localPrefix = "custom";
|
||||
if (opts.prefix) {
|
||||
localPrefix = opts.prefix;
|
||||
} else {
|
||||
localPrefix = (await Select.prompt({
|
||||
message: "What is the prefix of the local workspaces you want to sync?",
|
||||
@@ -704,6 +705,11 @@ const command = new Command()
|
||||
"--instance <instance:string>",
|
||||
"Name of the instance to pull from, override the active instance"
|
||||
)
|
||||
.option(
|
||||
"--prefix <prefix:string>",
|
||||
"Prefix of the local workspaces to pull, used to create the folders when using --include-workspaces"
|
||||
)
|
||||
|
||||
.action(instancePull as any)
|
||||
.command("push")
|
||||
.description(
|
||||
@@ -720,6 +726,10 @@ const command = new Command()
|
||||
"--instance <instance:string>",
|
||||
"Name of the instance to push to, override the active instance"
|
||||
)
|
||||
.option(
|
||||
"--prefix <prefix:string>",
|
||||
"Prefix of the local workspaces folders to push"
|
||||
)
|
||||
.action(instancePush as any)
|
||||
.command("whoami")
|
||||
.description("Display information about the currently logged-in user")
|
||||
|
||||
Reference in New Issue
Block a user