Replies: 4 comments 13 replies
-
Would it be too much to ask of rtx to symlink path like |
Beta Was this translation helpful? Give feedback.
-
I'm opposed to using shims in the general case. They solve some problems like this, but they come with a ton of baggage. At some point though it may make sense to add the ability for rtx to generate shims and I think it could work for some alternative use-cases like this. This isn't high on my priority though, but you could write your own shims really easily:
You'll need to do this for each binary you want to support though. Alternatively, we are doing basically the exact same thing as direnv, so you could also fork the direnv extension for whatever IDE you're using and make it work for RTX: https://github.com/misuzu/direnv-subl |
Beta Was this translation helpful? Give feedback.
-
btw if you control which binary it uses, say you're calling launchctl and you want it to use the right python, then just use |
Beta Was this translation helpful? Give feedback.
-
Update (2023-03-07): Since the introduction of experimental shim support, I use them for potential IDE needs. The script mentioned below is no longer used. I created a small helper tool for me to create symlinked PATHS for my global tool binaries. global_symlink_dir="$HOME/opt/global-path-symlinks"
# Python
python_base="$global_symlink_dir/python"
mkdir -p "$python_base"
ln -snf "$(rtx where python)/bin" "$python_base/bin" In the PATH, I can then use: In general, it is sufficient for me, that apps just have this global version available. With this solution, I only need to update the launchctl path, when a tool is added or removed from my global tool list. |
Beta Was this translation helpful? Give feedback.
-
I have perhaps a peculiar use-case (although it shouldn't be too uncommon):
I start GUI apps like Sublime Text, that needs access to rtx-managed versions for e.g. LSP functionality. When using asdf I could statically add
~/.asdf/shims
and~/.asdf/bin
to the launchctl path which would make GUI apps just use whatever was globally activated with asdf.However, with rtx there is no such static path. Setting the launchctl path can only be done manually and after which the Dock (!) in macOS has to be restarted (or you have to log out and in again). Obviously this is not realistic to use, because as soon as you've upgraded your globally configure version of a tool the old configured path would be out of date.
What would be a practical way to solve this with rtx? Maintain some kind of symlink on shell startup, like the global
~/.asdf/shims
?Beta Was this translation helpful? Give feedback.
All reactions