7105e37ef09ff890f7eca3e64d48b8b7ff94a494
- Author
- DemonKiller <55846983+demonkillerr@users.noreply.github.com>
- Committer
- GitHub <noreply@github.com>
- Date
Message
Diff
This diff is truncated to protect this page.
1diff --git a/plugins/rtx/README.md b/plugins/rtx/README.md
2new file mode 100644
3index 0000000000000000000000000000000000000000..c6436d3a7fb0fe62ac9f7187b4ff3dc371df183d
4--- /dev/null
5+++ b/plugins/rtx/README.md
6@@ -0,0 +1,30 @@
7+## rtx
8+
9+
10diff --git a/plugins/rtx/rtx.plugin.zsh b/plugins/rtx/rtx.plugin.zsh
11new file mode 100644
12index 0000000000000000000000000000000000000000..aaccaf01532f5332189ccff2f552c4aa96f741c2
13--- /dev/null
14+++ b/plugins/rtx/rtx.plugin.zsh
15@@ -0,0 +1,30 @@
16+# Find where rtx should be installed
17+RTX_DIR="${RTX_DIR:-$HOME/.rtx}"
18+RTX_COMPLETIONS="$RTX_DIR/completions"
19+
20+if [[ ! -f "$RTX_DIR/rtx.sh" || ! -f "$RTX_COMPLETIONS/_rtx" ]]; then
21+ # If not found, check for archlinux/AUR package (/opt/rtx-vm/)
22+ if [[ -f "/opt/rtx-vm/rtx.sh" ]]; then
23+ RTX_DIR="/opt/rtx-vm"
24+ RTX_COMPLETIONS="$RTX_DIR"
25+ # If not found, check for Homebrew package
26+ elif (( $+commands[brew] )); then
27+ _RTX_PREFIX="$(brew --prefix rtx)"
28+ RTX_DIR="${_RTX_PREFIX}/libexec"
29+ RTX_COMPLETIONS="${_RTX_PREFIX}/share/zsh/site-functions"
30+ unset _RTX_PREFIX
31+ else
32+ return
33+ fi
34+fi
35+
36+# Load command
37+if [[ -f "$RTX_DIR/rtx.sh" ]]; then
38+ source "$RTX_DIR/rtx.sh"
39+ # Load completions
40+ if [[ -f "$RTX_COMPLETIONS/_rtx" ]]; then
41+ fpath+=("$RTX_COMPLETIONS")
42+ autoload -Uz _rtx
43+ compdef _rtx rtx # compdef is already loaded before loading plugins
44+ fi
45+fi