Skip to content

Commit

Permalink
chore: tweaking link behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
aorumbayev committed Mar 10, 2024
1 parent e8200c0 commit 27715ca
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
12 changes: 10 additions & 2 deletions src/algokit/cli/project/link.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,18 @@ def link_command(
"""Automatically invoke 'algokit generate client' on contract projects available in the workspace.
Must be invoked from the root of a standalone 'frontend' typed project."""

project_data = _get_project_data()
config = get_algokit_config() or {}
project_data = config.get("project", {})

if not config:
click.secho("WARNING: No .algokit.toml config found. Skipping...", fg="yellow")
return

if not _is_frontend(project_data):
raise click.ClickException("This command is only available in a standalone frontend projects.")
click.secho(
"WARNING: This command is only available in a standalone frontend projects. Skipping...", fg="yellow"
)
return

frontend_artifacts_path = project_data.get("artifacts")
if not frontend_artifacts_path:
Expand Down
2 changes: 1 addition & 1 deletion tests/project/link/test_link.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,5 +206,5 @@ def test_link_command_empty_folder(
cwd = tmp_path_factory.mktemp("cwd")
result = invoke("project link --all", cwd=cwd)

assert result.exit_code == 1
assert result.exit_code == 0
verify(_format_output(result.output, [(str(cwd), "<cwd>")]))
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Error: No .algokit.toml config found.
WARNING: No .algokit.toml config found. Skipping...

0 comments on commit 27715ca

Please sign in to comment.