xtendo-org / chips

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

Running chips without making `config.fish` throws an exception #11

Closed simnalamburt closed 7 years ago

simnalamburt commented 8 years ago

If I run chips without making ~/.config/fish/config.fish, it throws an exception.

$ ./chips

chips: fish plugin manager
version 1.0.0
Build result saved at /home/simnalamburt/.config/chips/build.fish
chips: /home/simnalamburt/.config/fish/config.fish: openBinaryFile: does not exist (No such file or directory)

Proposal

if config.fish doesn't exist, I think making new config.fish and injecting chips codes would be an agreeable default behavior. How do you think?

xtendo-org commented 8 years ago

Thanks! This is indeed a bug.

Related code:

https://github.com/kinoru/chips/blob/b1799cd31d5f371a55596e8b7fd43dd1d802efcd/src/Lib.hs#L108-L111

It seems B.readFile fails if the file does not exist.

heejongahn commented 8 years ago

I've experienced similar problem when ~/.config/fish/functions folder does not exist (on Ubuntu 14.04).

error message: chips: /home/ubuntu/.config/fish/functions: copyFile: does not exist (No such file or directory)

Disappeared when mkdir ~/.config/fish/functions and re-ran chips.

heejongahn commented 8 years ago

Just checked #16.. sorry for the duplicate! Will wait for the next version release 😁

xtendo-org commented 7 years ago

Fixed in f14b127 and 23b4c85. Thanks!