post_create: skip the install hint when deps already installed (#91)

The 'uv sync' next-step is redundant when the LiveKit CLI already ran the
install task during `lk agent init --install`. Move it into a guarded subtask
that is skipped when LIVEKIT_DEPS_INSTALLED is set (the CLI sets it on a
successful install), matching the existing status-guard pattern used for
LIVEKIT_AGENT_NAME and LIVEKIT_SANDBOX_ID.
This commit is contained in:
u9g
2026-06-24 15:16:24 -04:00
committed by GitHub
parent 9bf4404101
commit 07a75c4369
+10 -2
View File
@@ -21,6 +21,14 @@ tasks:
- task: set_agent_name_if_present - task: set_agent_name_if_present
- task: help_open_sandbox_if_present - task: help_open_sandbox_if_present
help_install_hint_if_needed:
desc: "Print the local install hint, unless the CLI already installed dependencies"
status:
# Skip when `lk agent init --install` already ran the install task.
- test -n "$LIVEKIT_DEPS_INSTALLED"
cmds:
- echo '{{ indent .INDENT "uv sync" }}'
set_agent_name_if_present: set_agent_name_if_present:
status: status:
- test -z "$LIVEKIT_AGENT_NAME" - test -z "$LIVEKIT_AGENT_NAME"
@@ -42,7 +50,7 @@ tasks:
- echo 'To try your new agent directly in your terminal:' - echo 'To try your new agent directly in your terminal:'
- echo '' - echo ''
- echo '{{ indent .INDENT "cd" }} {{ .REL_PATH }}' - echo '{{ indent .INDENT "cd" }} {{ .REL_PATH }}'
- echo '{{ indent .INDENT "uv sync" }}' - task: help_install_hint_if_needed
- echo '{{ indent .INDENT "uv run" }} {{ .PYTHON_MAIN }} console' - echo '{{ indent .INDENT "uv run" }} {{ .PYTHON_MAIN }} console'
help_open_web_console: help_open_web_console:
@@ -55,7 +63,7 @@ tasks:
- echo 'To try your new agent in the web console:' - echo 'To try your new agent in the web console:'
- echo '' - echo ''
- echo '{{ indent .INDENT "cd" }} {{ .REL_PATH }}' - echo '{{ indent .INDENT "cd" }} {{ .REL_PATH }}'
- echo '{{ indent .INDENT "uv sync" }}' - task: help_install_hint_if_needed
- echo '{{ indent .INDENT "uv run" }} {{ .PYTHON_MAIN }} dev' - echo '{{ indent .INDENT "uv run" }} {{ .PYTHON_MAIN }} dev'
- echo '' - echo ''
- echo 'Then visit:' - echo 'Then visit:'