mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-10-18 16:03:24 +00:00
don't print success message when workspace add is cancelled (#8003)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
committed by
GitHub
co-authored by
Claude Opus 4.5
parent
0fe6722ad3
commit
6366087ede
@@ -260,7 +260,7 @@ export async function add(
|
||||
Deno.exit(1);
|
||||
}
|
||||
|
||||
await addWorkspace(
|
||||
const added = await addWorkspace(
|
||||
{
|
||||
name: workspaceName,
|
||||
remote: remote,
|
||||
@@ -269,6 +269,9 @@ export async function add(
|
||||
},
|
||||
opts
|
||||
);
|
||||
if (!added) {
|
||||
return;
|
||||
}
|
||||
await setActiveWorkspace(workspaceName, opts.configDir);
|
||||
|
||||
log.info(
|
||||
@@ -278,7 +281,7 @@ export async function add(
|
||||
);
|
||||
}
|
||||
|
||||
export async function addWorkspace(workspace: Workspace, opts: any) {
|
||||
export async function addWorkspace(workspace: Workspace, opts: any): Promise<boolean> {
|
||||
workspace.remote = new URL(workspace.remote).toString(); // add trailing slash in all cases!
|
||||
|
||||
// Check for conflicts before adding
|
||||
@@ -330,7 +333,7 @@ export async function addWorkspace(workspace: Workspace, opts: any) {
|
||||
|
||||
if (!overwrite) {
|
||||
log.info(colors.yellow("Operation cancelled."));
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -350,6 +353,7 @@ export async function addWorkspace(workspace: Workspace, opts: any) {
|
||||
await file.write(new TextEncoder().encode(JSON.stringify(workspace) + "\n"));
|
||||
|
||||
file.close();
|
||||
return true;
|
||||
}
|
||||
|
||||
export async function removeWorkspace(
|
||||
|
||||
Reference in New Issue
Block a user