diff --git a/README.md b/README.md index f9dea9c..b11f08d 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ cd github-watch Release installs show whether the installed plugin is current or whether a newer release is available. `Update to latest release` runs in the background, writes to `GITHUBWATCH_UPDATE_LOG`, and replaces the plugin with the latest release asset. Source checkout installs show the current branch and commit for diagnostics, but hide the menu updater to avoid overwriting checkout-managed files. Development updates should use normal git commands in the checkout. -The development installer uses a symlink, matching the `agent-watch` and `menutube` development workflow. The release installer copies a standalone plugin script. The menu updater is only for copied release installs; source checkout installs should be updated with `git pull`. +The development installer uses a symlink, matching the `agent-watch` and `menutube` development workflow. The release installer copies a standalone plugin script. The menu updater is only shown for copied release installs; source checkout installs show git metadata and should be updated with normal git commands. ## Requirements diff --git a/bin/github-watch.5m.sh b/bin/github-watch.5m.sh index 2801f08..1aaec56 100755 --- a/bin/github-watch.5m.sh +++ b/bin/github-watch.5m.sh @@ -1088,10 +1088,14 @@ print_plugin_rows() { local root git_summary version_label release_status release_color latest_release root="$(plugin_repo_root)" version_label="$(plugin_version_label "$root")" - maybe_refresh_release_check - release_status="$(release_status_label "$version_label")" - release_color="$(release_status_color "$release_status")" - emit "--Version: ${version_label} (${release_status}) | font=Menlo color=$release_color" + if [[ -z "$root" ]]; then + maybe_refresh_release_check + release_status="$(release_status_label "$version_label")" + release_color="$(release_status_color "$release_status")" + emit "--Version: ${version_label} (${release_status}) | font=Menlo color=$release_color" + else + emit "--Version: ${version_label} | font=Menlo" + fi emit "--Config: $(shorten_path "$CONFIG_FILE") | font=Menlo" emit "--Script: $(shorten_path "$PLUGIN_PATH") | font=Menlo" print_gh_status_rows @@ -1099,7 +1103,7 @@ print_plugin_rows() { git_summary="$(plugin_git_summary "$root")" emit "--Repo: $(shorten_path "$root") | font=Menlo" emit "--Git: ${git_summary:-unknown} | font=Menlo" - emit "----Source/dev install: update with git pull, not script replacement | color=gray" + emit "----Use git commands for development updates | color=gray" else latest_release="$(cached_latest_release_tag 2>/dev/null || true)" if [[ -n "$latest_release" && "$(release_tag_norm "$latest_release")" != "$(release_tag_norm "$version_label")" ]]; then diff --git a/scripts/check.sh b/scripts/check.sh index 8753c8a..68661ca 100755 --- a/scripts/check.sh +++ b/scripts/check.sh @@ -64,6 +64,28 @@ print -r -- "$output" | grep -q '^GH setup needed' print -r -- "$output" | grep -q '^GitHub Watch$' print -r -- "$output" | grep -q 'Open config file' print -r -- "$output" | grep -q 'Open project page' +print -r -- "$output" | grep -q 'Use git commands for development updates' +if print -r -- "$output" | grep -q 'Update to latest release'; then + print -u2 "source checkout installs should not show the release updater" + exit 1 +fi + +tmp_release_dir="$(mktemp -d)" +cp "$PLUGIN" "$tmp_release_dir/github-watch.5m.sh" +chmod +x "$tmp_release_dir/github-watch.5m.sh" +release_output="$( + GITHUBWATCH_CONFIG_FILE="$tmp_release_dir/config.env" \ + GITHUBWATCH_CACHE_FILE="$tmp_release_dir/inventory.json" \ + GITHUBWATCH_RELEASE_CHECK_CACHE="$tmp_release_dir/release-check.tsv" \ + GITHUBWATCH_DISABLE_GH=1 \ + GITHUBWATCH_CHECK_RELEASE_UPDATES=0 \ + "$tmp_release_dir/github-watch.5m.sh" +)" +print -r -- "$release_output" | grep -q 'Update to latest release' +if print -r -- "$release_output" | grep -q 'Use git commands for development updates'; then + print -u2 "copied release installs should not show source checkout update guidance" + exit 1 +fi missing_gh_output="$( GITHUBWATCH_CONFIG_FILE="$config_file" \