xtendo-org / chips

A fast, lightweight, and concurrent plugin manager for the fish shell, written in Haskell
73 stars 3 forks source link

[RFC] Inject alias for chips at config.fish #13

Closed simnalamburt closed 8 years ago

simnalamburt commented 8 years ago

Current implementation just injects the line to the config.fish below:

# chips (don't touch the line below!)
if [ -e ~/.config/chips/build.fish ] ; source ~/.config/chips/build.fish ; end

And current implementation seems to be assuming that chips executable file is located at ~/.local/bin/chips

-- https://github.com/kinoru/chips/blob/master/src/Lib.hs#L57
execPath <- (byteString <$> getExecutablePath) >>= \ p ->
    if "/ghc" `B.isSuffixOf` p
    then (<> "/.local/bin/chips") . byteString <$> getHomeDirectory
    else return p

Then why don't we add the alias for chips at the config.fish? It will provide better default and better UX to the users.

# chips (don't touch the lines below!)
alias chips "~/.local/bin/chips; and exec fish"
if [ -e ~/.config/chips/build.fish ]; source ~/.config/chips/build.fish; end
xtendo-org commented 8 years ago

Duplicate of #6. Solved by a0285b6af1b88e3132741ddf6c79c5a2d9c859b3.