setup-util: support pkgx#293
Open
joelmccracken wants to merge 3 commits intobevry:masterfrom
Open
Conversation
cecd4d2 to
9f1febe
Compare
balupton
added a commit
that referenced
this pull request
Oct 3, 2025
Changes: - Removed outdated/stale/deprecated autocompleters of the old github copilot and tea. - Also, update the URL and GitHub for carapace which has now been updated. The new GitHub CLI is now available via <https://github.com/github/copilot-cli> Which is an app rather than an autocompleter. Remove the old ones: - `npm uninstall -g github-copilot-cli` for <https://www.npmjs.com/package/@githubnext/github-copilot-cli> - `gh extension remove github/gh-copilot` for <https://github.com/github/gh-copilot> Tea is vapourware (no github activity, all tea.xyz URLs 404). Its innovation now live on as PKGX, which isn't about autocomplete. As such, remove tea autocomplete. The `setup-util` code for tea persists, as it can be worked later for PKGX, /ref #293
pkgx
balupton
added a commit
that referenced
this pull request
Oct 25, 2025
Changes: - Removed outdated/stale/deprecated autocompleters of the old github copilot and tea. - Also, update the URL and GitHub for carapace which has now been updated. The new GitHub CLI is now available via <https://github.com/github/copilot-cli> Which is an app rather than an autocompleter. Remove the old ones: - `npm uninstall -g github-copilot-cli` for <https://www.npmjs.com/package/@githubnext/github-copilot-cli> - `gh extension remove github/gh-copilot` for <https://github.com/github/gh-copilot> Tea is vapourware (no github activity, all tea.xyz URLs 404). Its innovation now live on as PKGX, which isn't about autocomplete. As such, remove tea autocomplete. The `setup-util` code for tea persists, as it can be worked later for PKGX, /ref #293
balupton
added a commit
that referenced
this pull request
Oct 25, 2025
Changes: - Removed outdated/stale/deprecated autocompleters of the old github copilot and tea. - Also, update the URL and GitHub for carapace which has now been updated. The new GitHub CLI is now available via <https://github.com/github/copilot-cli> Which is an app rather than an autocompleter. Remove the old ones: - `npm uninstall -g github-copilot-cli` for <https://www.npmjs.com/package/@githubnext/github-copilot-cli> - `gh extension remove github/gh-copilot` for <https://github.com/github/gh-copilot> Tea is vapourware (no github activity, all tea.xyz URLs 404). Its innovation now live on as PKGX, which isn't about autocomplete. As such, remove tea autocomplete. The `setup-util` code for tea persists, as it can be worked later for PKGX, /ref #293
balupton
added a commit
that referenced
this pull request
Oct 25, 2025
Changes: - Removed outdated/stale/deprecated autocompleters of the old github copilot and tea. - Also, update the URL and GitHub for carapace which has now been updated. The new GitHub CLI is now available via <https://github.com/github/copilot-cli> Which is an app rather than an autocompleter. Remove the old ones: - `npm uninstall -g github-copilot-cli` for <https://www.npmjs.com/package/@githubnext/github-copilot-cli> - `gh extension remove github/gh-copilot` for <https://github.com/github/gh-copilot> Tea is vapourware (no github activity, all tea.xyz URLs 404). Its innovation now live on as PKGX, which isn't about autocomplete. As such, remove tea autocomplete. The `setup-util` code for tea persists, as it can be worked later for PKGX, /ref #293
Member
|
I'm removing # note that tea doesn't provide man pages, even via [tea man bat]
function remove_tea_cache {
local package="$1" subpath path
# this entire cache of the package must be removed, not just [tea -n "$option_cli"]
# see https://discord.com/channels/906608167901876256/906608288026734622/1134327807544135770
subpath="${package:1}" # get everything after the +
path="$HOME/.tea/$subpath"
if [[ -d $path ]]; then
rm_helper "$path"
return 0
fi
return 200 # ECUSTOM 200 Not applicable to this package system
}
function remove_tea_xdg_bin_alias {
if is-symlink -- "$XDG_BIN_HOME/$option_cli"; then
if [[ "$(fs-path --resolve -- "$XDG_BIN_HOME/$option_cli")" == "$(type -P tea)" ]]; then
rm_helper "$XDG_BIN_HOME/$option_cli"
return 0 # is applicable
fi
fi
return 200 # ECUSTOM 200 Not applicable to this package system
}
function remove_tea_package {
local package="$1" ec1 ec2
__do --redirect-status={ec1} -- remove_tea_xdg_bin_alias
__do --redirect-status={ec2} -- remove_tea_cache "$package"
if [[ $ec1 -ne 0 && $ec1 -ne 200 ]]; then
return "$ec1" # error
elif [[ $ec2 -ne 0 && $ec2 -ne 200 ]]; then
return "$ec2" # error
elif [[ $ec1 -eq 0 || $ec2 -eq 0 ]]; then
return 0 # was applicable
else
return 200 # ECUSTOM 200 Not applicable to this package system
fi
}
function __check_tea {
local packages=("${TEA[@]}")
# check if applicable
if [[ ${#packages[@]} -eq 0 ]]; then
return 200 # ECUSTOM 200 Not applicable to this utility
fi
if __command_missing -- tea; then
fallbacks+=('tea')
return 200 # ECUSTOM 200 Not applicable yet but provided fallback
fi
if [[ -z $option_cli ]]; then
__print_style --stderr --error='TEA requires <cli>'
return 22 # EINVAL 22 Invalid argument
fi
if [[ -z $option_cli ]]; then
__print_style --stderr --error='TEA requires <cli>'
return 22 # EINVAL 22 Invalid argument
fi
}
function do_tea {
local packages=("${TEA[@]}") repo tea_status result=200
# handle each package
for package in "${packages[@]}"; do
# check
if [[ $package != '+'* ]]; then
__print_style --stderr --error1='TEA packages must begin with a plus sign ' --code-error1='+' --error1=' e.g. ' --code-error1="--cli='jq' TEA='+stedolan.github.io/jq'"
return 22 # EINVAL 22 Invalid argument
fi
# uninstall
if [[ $option_action == 'uninstall' ]]; then
__try {tea_status} -- remove_tea_package "$package"
if [[ $tea_status -eq 0 ]]; then
result=0
fi
else
# install / upgrade
result=0
# install it by doing [tea $package --version]
# it would be nice to use [command-working] however [command-working] currently expects multiple commands as arguments so it would become [command-working -- tea, command-working $package, command-working --version]
tea "$package" "$option_cli" --version
# make tea alias available
__mkdirp "$XDG_BIN_HOME"
fs-link --quiet="$option_quiet" \
--existing="$(type -P tea)" --symlink="$XDG_BIN_HOME/$option_cli"
fi
done
return "$result"
}
function do_tea_fallback {
log_fallback 'Tea'
setup-util-tea --quiet="$option_quiet"
source "$DOROTHY/sources/environment.sh"
do_tea "$@"
} |
Member
|
Flox seems to be another likewise tool: https://flox.dev/ I guess the market for such tooling has opened up and we are going to see a lot of grifts. |
0403c8c to
38c051b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
done with this for the night, just submitting now for some review. I'd like to actually write a test or two so I can be confident I actually did the logic right.