Skip to content

fix(install): warn when shelltime-daemon is missing from archive#10

Merged
AnnatarHe merged 1 commit into
mainfrom
claude/fix-linux-daemon-binary-ZX5pQ
May 20, 2026
Merged

fix(install): warn when shelltime-daemon is missing from archive#10
AnnatarHe merged 1 commit into
mainfrom
claude/fix-linux-daemon-binary-ZX5pQ

Conversation

@AnnatarHe
Copy link
Copy Markdown
Contributor

Summary

Previously the script silently skipped the daemon move when shelltime-daemon was absent from the extracted tarball, leaving Linux users without a working daemon and no signal that anything went wrong. This made bugs like the pre-36a09e9 .bak rename hard to spot in the wild.

Now print a clear stderr warning when the daemon binary is missing, pointing out that the CLI will attempt to auto-download it on first shelltime daemon install/reinstall.

Kept non-fatal because:

  1. Paired CLI change adds EnsureDaemonBinary which self-heals on next shelltime daemon install.
  2. We still want the rest of the install (hooks, PATH setup, daemon dir) to complete so shelltime itself works.

Test plan

  • bash -n install.bash — syntax OK
  • Manual: download a release tarball, delete shelltime-daemon from the extract, run the script, confirm the WARNING block appears on stderr and the rest of installation completes
  • Existing CI workflow exercises the happy path on Ubuntu and macOS across zsh/bash/fish

https://claude.ai/code/session_01ThKSJA9sGXQm8jMeCZZdYY


Generated by Claude Code

Previously the script silently skipped the daemon move when
shelltime-daemon was absent from the extracted tarball, leaving Linux
users without a working daemon and no signal that anything went wrong.

Now print a clear stderr warning pointing out that the CLI will attempt
to auto-download the daemon on first `shelltime daemon install`. Keep
the script non-fatal so the rest of the install (hooks, PATH, daemon dir)
still completes.

https://claude.ai/code/session_01ThKSJA9sGXQm8jMeCZZdYY
@claude
Copy link
Copy Markdown

claude Bot commented May 19, 2026

Code Review

Overview

This PR adds a stderr warning when shelltime-daemon is missing from the extracted tarball during installation. The warning is non-fatal — the rest of the install (hooks, PATH setup, daemon dir) still completes — which is well-reasoned given the paired CLI change that auto-heals on next shelltime daemon install/reinstall.


What's Good

  • Correct stream: Writing to stderr (>&2) is exactly right for warnings that shouldn't pollute stdout capture.
  • Actionable message: The warning tells users what is missing and what to do — no guesswork needed.
  • Non-fatal by design: The reasoning in the PR description is sound. Blocking the install over a missing daemon binary would be a regression for users who just need the CLI.
  • $FILENAME in the message: Referencing the actual archive name gives users a concrete starting point for debugging.
  • Commit message follows Conventional Commits per CLAUDE.md conventions. ✓

Suggestions

1. Minor style: echo ""echo (no args)

echo with no arguments already emits a blank line. echo "" works but is non-idiomatic in bash:

-        echo "" >&2
+        echo >&2

2. Consider collapsing to a single printf call

Five echo calls for one logical message is verbose. A single printf is more compact and avoids repeated >&2 redirections:

    else
        printf '\nWARNING: shelltime-daemon binary was NOT found in %s.\n         The CLI will attempt to auto-download it on first\n         '"'"'shelltime daemon install/reinstall'"'"'.\n\n' "$FILENAME" >&2

Or with a heredoc-style redirect (cleaner for multi-line):

    else
        {
            echo
            echo "WARNING: shelltime-daemon binary was NOT found in $FILENAME."
            echo "         The CLI will attempt to auto-download it on first"
            echo "         'shelltime daemon install/reinstall'."
            echo
        } >&2

This is a style nit — the current approach is perfectly functional.

3. Test coverage gap

The manual sad-path test item is unchecked:

  • Manual: download a release tarball, delete shelltime-daemon from the extract, run the script…

This is the only real validation of the new code path. It would be worth checking this off (or noting it was tested) before merging, since bash -n only checks syntax, not runtime behavior. If a CI fixture for a stripped tarball is ever feasible, it would close this gap permanently.


Potential Issue — $FILENAME scope

The warning references $FILENAME. As long as this variable is set earlier in the Darwin/Linux block (which it appears to be from the script structure), it's fine. If it were ever unset, the message would silently drop that part with no error. Low risk given existing usage, but worth a quick sanity check.


Summary

This is a small, well-motivated fix that meaningfully improves the installation experience for users with incomplete release archives. The logic is correct, the non-fatal choice is well justified, and the message is clear. Addressing the echo "" nit and the grouped-redirect style would tighten things up, but neither is blocking. Main ask before merge: confirm the manual sad-path test has been exercised.

Verdict: Approve with minor nits

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the install.bash script to include a warning message when the shelltime-daemon binary is missing during installation. The feedback suggests refining this warning message to provide a more explicit, actionable command for the user, noting that the automatic installation step might fail if the binary is not yet in the system's PATH.

Comment thread install.bash
Comment on lines +148 to +152
echo "" >&2
echo "WARNING: shelltime-daemon binary was NOT found in $FILENAME." >&2
echo " The CLI will attempt to auto-download it on first" >&2
echo " 'shelltime daemon install/reinstall'." >&2
echo "" >&2
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The warning message is a helpful addition. However, the current wording is somewhat passive. Since the automatic attempt to reinstall the daemon at the end of this script (line 296) will likely fail on fresh installations (because the shelltime binary is not yet in the current shell's PATH and the output is suppressed), providing an explicit, actionable command for the user is more robust. This ensures they know exactly how to resolve the missing daemon issue if the automatic step fails silently.

Suggested change
echo "" >&2
echo "WARNING: shelltime-daemon binary was NOT found in $FILENAME." >&2
echo " The CLI will attempt to auto-download it on first" >&2
echo " 'shelltime daemon install/reinstall'." >&2
echo "" >&2
echo "" >&2
echo "WARNING: shelltime-daemon binary was NOT found in $FILENAME." >&2
echo " The CLI will attempt to auto-download it. Please run:" >&2
echo " $HOME/.shelltime/bin/shelltime daemon install" >&2
echo "" >&2

@AnnatarHe AnnatarHe merged commit c5752c0 into main May 20, 2026
4 of 9 checks passed
@AnnatarHe AnnatarHe deleted the claude/fix-linux-daemon-binary-ZX5pQ branch May 20, 2026 02:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants