edc / bass

Make Bash utilities usable in Fish shell
MIT License
2.2k stars 70 forks source link

Support aliases #21

Closed alexpearce closed 7 years ago

alexpearce commented 8 years ago

I've come across bash scripts that define aliases, to shorten paths to executables for example, such as

# Source me
alias foobar='/path/to/some_long_executable_name.extension'

Sourcing such a script with bass does not convert the bash alias to a fish one. This can be seen interactively:

$ bass alias foobar='ls'
$ foobar
fish: Unknown command 'foobar'

As far as I can tell, bass works by comparing the output of bash's env before and after running the command passed to bass, so any aliases defined won't be captured.

bass could additionally compare the output of bash's alias, which prints all defined aliases.

edc commented 8 years ago

@alexpearce great idea. Not sure when I will have time to add that. Patch welcome though :)

alexpearce commented 8 years ago

I can see if it can work, for sure.

Can you think of something that might make this a non-starter, or only applicable for certain aliases? I have a feeling I had something when I wrote the PR, but now I can't remember 😞

marcosfede commented 7 years ago

Is there any progress on this? I just found about bass and It's what I've been missing, but I wish my aliases script would work with fish

edc commented 7 years ago

Just added alias support. LMK if you run into issues:

$ bass alias "xx='echo lol'"
$ xx
lol