Closed meramsey closed 2 years ago
hi @meramsey!
I'm not the user of nvm
but I think the ExecAlias
with $args
will work:
aliases['nvm'] = """bash -c @(f'[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" && nvm {" ".join($args)}')"""
nvm
# Node Version Manager (v0.39.1)
# ...
nvm --version
# 0.39.1
You can wrap any bash commands this way.
wow you sir are genious and this works perfectly. This is what I love about xonsh is that possibilities are endless.
Thanks for taking the time to share with me. learned something new here.
For example the only way I can use nvm in xonsh is with
Doing this in terminal works fine
If i setup an alias to make it easier to do that it fails
I get an error like this
If i try to put all but the ! in the alias and then use ! nvm which is an alias for
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" && nvm
it also doesn't like that I think as its being expanded in bash and skipping the xontrib loading.Seems like I should be able to create an alias that calls it through the sh thing like doing it manually would, but I probably missed that option.
Any tips would be super appreciated. This plugin is what really ensured I didn't give up on xonsh. The convenience of being able to prefix is amazing. I'm just curious if there is a way to make an alias or callable that mimics me entering the ! at the beginning before its executed.