-
Notifications
You must be signed in to change notification settings - Fork 1
fix(web,install): model refresh UI + CLI-only install summary #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -403,8 +403,8 @@ print_banner() { | |
| local mode="download (prebuilt)" | ||
| $BUILD_FROM_SOURCE && mode="build-from-source" | ||
| print_box "Catalyst Code — installer v${VERSION_DETECTED}" \ | ||
| "TUI (catcode) + core (catcode-core) -> PATH" \ | ||
| "optional 24/7 web service (Next.js, prebuilt)" \ | ||
| "TUI (catcode, core embedded) -> PATH" \ | ||
| "optional web service (+ catcode-core) via --with-web" \ | ||
|
Comment on lines
+406
to
+407
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Make the banner conditional for source builds. When Build these lines from Proposed fix local mode="download (prebuilt)"
$BUILD_FROM_SOURCE && mode="build-from-source"
+ local tui_line="TUI (catcode, core embedded) -> PATH"
+ local web_line="optional web service (+ catcode-core) via --with-web"
+ if $BUILD_FROM_SOURCE; then
+ tui_line="TUI (catcode, separate core) -> PATH"
+ web_line="optional web service; catcode-core is installed for source builds"
+ fi
print_box "Catalyst Code — installer v${VERSION_DETECTED}" \
- "TUI (catcode, core embedded) -> PATH" \
- "optional web service (+ catcode-core) via --with-web" \
+ "$tui_line" \
+ "$web_line" \🤖 Prompt for AI Agents |
||
| "scope: system-wide | platform: ${PLATFORM} (${SVC_MGR})" | ||
| printf " ${C_DIM}mode: %s | dry-run: %s${C_RST}\n\n" "$mode" "$DRY_RUN" | ||
| } | ||
|
|
@@ -1557,6 +1557,17 @@ do_status() { | |
| summary_install() { | ||
| local web_line="(not installed — run with --with-web)" | ||
| local svc_line="" | ||
| local core_line | ||
| # Download CLI-only ships an embed_core TUI (extracts core to ~/.cache on | ||
| # first run). A separate catcode-core on PATH is only installed with --with-web | ||
| # (web service needs CATCODE_CORE) or --build-from-source. Do not probe | ||
| # $PREFIX for an existing binary — a leftover from a prior --with-web | ||
| # install would make a CLI-only summary lie about what this run installed. | ||
| if $WITH_WEB || $BUILD_FROM_SOURCE; then | ||
| core_line="core: $PREFIX/catcode-core" | ||
| else | ||
| core_line="core: embedded in TUI (extracted on first run)" | ||
| fi | ||
| if $WITH_WEB; then | ||
| local svc_id="$UNIT_NAME" | ||
| [[ "$PLATFORM" == "Darwin" ]] && svc_id="$LAUNCHD_LABEL (launchd)" | ||
|
|
@@ -1570,16 +1581,22 @@ summary_install() { | |
| fi | ||
| local expose_line="" | ||
| $WITH_WEB && expose_line="expose: ${EXPOSE_MODE} origin: ${ORIGIN:-<auto>}" | ||
| print_box "✓ Installed ${APP_NAME} v${VERSION_DETECTED}" \ | ||
| "tui: $PREFIX/catcode" \ | ||
| "core: $PREFIX/catcode-core" \ | ||
| "web: $web_line" \ | ||
| "$expose_line" \ | ||
| "$svc_line" \ | ||
|
|
||
| "update: catcode --update (or bash install.sh --update)" \ | ||
| "uninstall: bash install.sh --uninstall" \ | ||
| # Build the box line list without empty entries or a blank line after `\` | ||
| # (a bare newline mid-continuation makes bash try to execute the next | ||
| # string as a command — set -e then aborts the installer after success). | ||
| local box_lines=( | ||
| "tui: $PREFIX/catcode" | ||
| "$core_line" | ||
| "web: $web_line" | ||
| ) | ||
| [[ -n "$expose_line" ]] && box_lines+=("$expose_line") | ||
| [[ -n "$svc_line" ]] && box_lines+=("$svc_line") | ||
| box_lines+=( | ||
| "update: catcode --update (or bash install.sh --update)" | ||
| "uninstall: bash install.sh --uninstall" | ||
| "log: ${LOG_FILE:-<disabled>}" | ||
| ) | ||
| print_box "✓ Installed ${APP_NAME} v${VERSION_DETECTED}" "${box_lines[@]}" | ||
| log_info "Run the TUI with: catcode" | ||
| if $WITH_WEB && ! $SKIP_SERVICE; then | ||
| if [[ "$PLATFORM" == "Darwin" ]]; then | ||
|
|
@@ -1601,12 +1618,20 @@ summary_update() { | |
| [[ "${WEB_INSTALLED:-no}" == yes ]] && web_line="http://${HOST}:${PORT} (restarted)" | ||
| local expose_line="" | ||
| [[ "${WEB_INSTALLED:-no}" == yes ]] && expose_line="expose: ${EXPOSE_MODE} origin: ${ORIGIN:-<auto>}" | ||
| print_box "✓ Updated ${APP_NAME} v${VERSION_DETECTED}" \ | ||
| "tui: $PREFIX/catcode" \ | ||
| "core: $PREFIX/catcode-core" \ | ||
| "web: $web_line" \ | ||
| "$expose_line" \ | ||
| "source: ${METHOD:-download} @ ${BASE_URL:-${REPO_DIR:-<unknown>}}" | ||
| local core_line | ||
| if [[ "${WEB_INSTALLED:-no}" == yes ]] || $BUILD_FROM_SOURCE || $WITH_WEB; then | ||
| core_line="core: $PREFIX/catcode-core" | ||
| else | ||
| core_line="core: embedded in TUI (extracted on first run)" | ||
| fi | ||
| local box_lines=( | ||
| "tui: $PREFIX/catcode" | ||
| "$core_line" | ||
| "web: $web_line" | ||
| ) | ||
| [[ -n "$expose_line" ]] && box_lines+=("$expose_line") | ||
| box_lines+=("source: ${METHOD:-download} @ ${BASE_URL:-${REPO_DIR:-<unknown>}}") | ||
| print_box "✓ Updated ${APP_NAME} v${VERSION_DETECTED}" "${box_lines[@]}" | ||
|
Comment on lines
+1621
to
+1634
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
rg -n -C 8 \
'summary_update|WEB_INSTALLED|BUILD_FROM_SOURCE|WITH_WEB|METHOD|load.*state|state.*load' \
install.shRepository: catalystctl/catcode Length of output: 26579 🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
sed -n '1007,1345p' install.sh
printf '\n--- action dispatch ---\n'
sed -n '1348,1560p' install.shRepository: catalystctl/catcode Length of output: 18035 🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
# Read-only behavioral probe: derive summary_update core_line for representative
# source-install CLI-only state and an update run without explicit --build-from-source.
python3 - <<'PY'
base = {"METHOD": "source", "REPO_DIR": "/tmp/catalyst-code", "VERSION": "1.2.3"}
for cli_with_web, cli_build_from_source in [(False, False), (False, True), (True, False), (True, True)]:
state = dict(base)
state["WEB_INSTALLED"] = "yes" if cli_with_web else "no"
# simulate the update dispatch flags before do_update_source (from do_update)
if state["WEB_INSTALLED"] == "yes":
with_web = True
else:
with_web = cli_with_web
build_from_source = state.get("METHOD") == "source" and cli_build_from_source
core_line = "$PREFIX/catcode-core" if state["WEB_INSTALLED"] == "yes" or build_from_source or with_web else "embedded in TUI (extracted on first run)"
lines = [f"cli_with_web={cli_with_web}, cli_build_from_source={cli_build_from_source} ->"]
lines.append(f" state.METHOD={state['METHOD']}, state.WEB_INSTALLED={state['WEB_INSTALLED']}")
lines.append(f" effective with_web={with_web}, build_from_source={build_from_source}")
lines.append(f" core_line={core_line}")
print("\n".join(lines))
PYRepository: catalystctl/catcode Length of output: 899 Restore For a source-installed CLI-only install, 🤖 Prompt for AI Agents |
||
| log_info "Run the TUI with: catcode" | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: catalystctl/catcode
Length of output: 2424
Document the platform user cache directory.
embeddedCorePath()usesos.UserCacheDir()before appendingcatalyst-code, so the documented fixed path can be wrong whenXDG_CACHE_HOME, macOS~/Library/Caches, or unavailable user cache paths are in effect. Use “the platform user cache directory” or list platform-specific paths.Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents