Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/codegate/pipeline/cli/commands.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -63,11 +63,11 @@ async def _add_workspace(self, args: List[str]) -> str:
Add a workspace
"""
if args is None or len(args) == 0:
return "Please provide a name. Use `codegate-workspace add your_workspace_name`"
return "Please provide a name. Use `codegateworkspace add your_workspace_name`"

new_workspace_name = args[0]
if not new_workspace_name:
return "Please provide a name. Use `codegate-workspace add your_workspace_name`"
return "Please provide a name. Use `codegateworkspace add your_workspace_name`"

workspace_created = await self.workspace_crud.add_workspace(new_workspace_name)
if not workspace_created:
Expand All@@ -83,17 +83,17 @@ async def _activate_workspace(self, args: List[str]) -> str:
Activate a workspace
"""
if args is None or len(args) == 0:
return "Please provide a name. Use `codegate-workspace activate workspace_name`"
return "Please provide a name. Use `codegateworkspace activate workspace_name`"

workspace_name = args[0]
if not workspace_name:
return "Please provide a name. Use `codegate-workspace activate workspace_name`"
return "Please provide a name. Use `codegateworkspace activate workspace_name`"

was_activated = await self.workspace_crud.activate_workspace(workspace_name)
if not was_activated:
return (
f"Workspace **{workspace_name}** does not exist or was already active. "
f"Use `codegate-workspace add {workspace_name}` to add it"
f"Use `codegateworkspace add {workspace_name}` to add it"
)
return f"Workspace **{workspace_name}** has been activated"

Expand Down
4 changes: 2 additions & 2 deletions tests/pipeline/workspace/test_workspace.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -54,9 +54,9 @@ async def test_list_workspaces(mock_workspaces, expected_output):
"args, existing_workspaces, expected_message",
[
# Case 1: No workspace name provided
([], [], "Please provide a name. Use `codegate-workspace add your_workspace_name`"),
([], [], "Please provide a name. Use `codegateworkspace add your_workspace_name`"),
# Case 2: Workspace name is empty string
([""], [], "Please provide a name. Use `codegate-workspace add your_workspace_name`"),
([""], [], "Please provide a name. Use `codegateworkspace add your_workspace_name`"),
# Case 3: Successful add
(["myworkspace"], [], "Workspace **myworkspace** has been added"),
],
Expand Down