mirror of
https://github.com/jimeh/dotfiles.git
synced 2026-02-19 13:46:41 +00:00
fix(karabiner/custom): use correct identifier for Warp
This commit is contained in:
@@ -7,13 +7,31 @@
|
||||
# ==============================================================================
|
||||
|
||||
list_go_global_packages() {
|
||||
for bin in $(ls -1 ~/.go/bin); do
|
||||
go version -m ~/.go/bin/$bin | grep '^[[:space:]]path' | awk '{ print $2 }'
|
||||
local bindir="${GOBIN:-$(go env GOBIN)}"
|
||||
if [ -z "$bindir" ]; then
|
||||
echo "GOBIN is not set"
|
||||
return 1
|
||||
fi
|
||||
|
||||
for cmd in $(ls -1 "${GOBIN}"); do
|
||||
go version -m "${GOBIN}/${cmd}" | grep '^[[:space:]]path' | awk '{ print $2 }'
|
||||
done
|
||||
}
|
||||
|
||||
install_go_global_packages() {
|
||||
local packages=(
|
||||
github.com/fatih/gomodifytags@latest
|
||||
github.com/go-delve/delve/cmd/dlv@latest
|
||||
github.com/josharian/impl@latest
|
||||
github.com/rakyll/hey@latest
|
||||
github.com/rogpeppe/godef@latest
|
||||
go.uber.org/mock/mockgen@latest
|
||||
golang.org/x/tools/cmd/godoc@latest
|
||||
golang.org/x/tools/cmd/goimports@latest
|
||||
golang.org/x/tools/gopls@latest
|
||||
golang.org/x/vuln/cmd/govulncheck@latest
|
||||
google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
|
||||
google.golang.org/protobuf/cmd/protoc-gen-go@latest
|
||||
)
|
||||
|
||||
for package in "${packages[@]}"; do
|
||||
|
||||
@@ -30,14 +30,35 @@ if command-exists kubectl; then
|
||||
fi
|
||||
fi
|
||||
|
||||
# Download completion scripts for kubectx and kubens from their git repo at
|
||||
# their respective versions. This is required as neither command has an option
|
||||
# to output their completion scripts, unlike most tools.
|
||||
_setup-kubectx-completion() {
|
||||
local cmd="$1"
|
||||
local dir="$HOME/.local/share/mise/installs/kubectx/latest/completion"
|
||||
local src="${dir}/_${cmd}.zsh"
|
||||
local version
|
||||
local src_url
|
||||
local tmpfile
|
||||
|
||||
if [[ ! -f "$src" ]]; then return; fi
|
||||
# If the command already has completions, don't do anything.
|
||||
if whence -w "_${cmd}" > /dev/null; then return; fi
|
||||
|
||||
setup-completions "$cmd" "$src" cat "$src"
|
||||
tmpfile="$(mktemp -d)/_${cmd}.zsh"
|
||||
version="$(printf '%s' "$(command "$cmd" --version 2> /dev/null)")"
|
||||
version="${version#v}"
|
||||
src_url="https://github.com/ahmetb/kubectx/raw/refs/tags/v${version}/completion/_${cmd}.zsh"
|
||||
|
||||
echo "Completion script for ${cmd} (v#{version}) not found. Download and install?"
|
||||
echo
|
||||
echo " Download from: ${src_url}"
|
||||
echo " Save to: ${tmpfile}"
|
||||
echo
|
||||
read -q "REPLY?Continue? [y/N]:" || return
|
||||
echo
|
||||
echo
|
||||
|
||||
curl -L "$src_url" -o "${tmpfile}" &&
|
||||
echo &&
|
||||
setup-completions "$cmd" "$(command-path "$cmd")" cat "$tmpfile"
|
||||
}
|
||||
|
||||
if command-exists kubectx; then
|
||||
|
||||
@@ -67,6 +67,5 @@ install_ruby_global_packages() {
|
||||
yard
|
||||
)
|
||||
|
||||
gem install --no-document rbenv-rehash
|
||||
gem install --no-document "${packages[@]}"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user