doron-cohen / antidot

Cleans up your $HOME from those pesky dotfiles
MIT License
305 stars 18 forks source link

`antidot init | source` fails with Fish #177

Closed poperigby closed 2 years ago

poperigby commented 2 years ago

I generated env.fish with antidot clean, and then when I run antidot init | source it errors out with this:

set: Variable name 'XDG_CONFIG_HOME=/home/cassidy/.config' is not valid. See `help identifiers`.

- (line 1):
set -q XDG_CONFIG_HOME; or set -x XDG_CONFIG_HOME="/home/cassidy/.config"
                           ^
from sourcing file -

(Type 'help set' for related documentation)
set: Variable name 'XDG_CACHE_HOME=/home/cassidy/.cache' is not valid. See `help identifiers`.

- (line 2):
set -q XDG_CACHE_HOME; or set -x XDG_CACHE_HOME="/home/cassidy/.cache"
                          ^
from sourcing file -

(Type 'help set' for related documentation)
set: Variable name 'XDG_DATA_HOME=/home/cassidy/.local/share' is not valid. See `help identifiers`.

- (line 3):
set -q XDG_DATA_HOME; or set -x XDG_DATA_HOME="/home/cassidy/.local/share"
                         ^
from sourcing file -

(Type 'help set' for related documentation)

I'm using v0.6.2-1 on Arch Linux.

doron-cohen commented 2 years ago

Interesting. I was working with fish shell when writing this code and it worked. I will have to investigate this.

magnus-ISU commented 2 years ago

I believe I was running into this as well on Garuda Linux, antidot init would sometimes print the POSIX shell script instead anyway.

A solution is to put antidot init -s fish instead of just antidot init; though there is still a bug.

Also apparently I closed all my merge requests and didn't reopen one, gonna fix that (EDIT: nope, its just blending in with the stupid dependabot PRs)

magnus-ISU commented 2 years ago

The problem is that $SHELL is not reset unless a shell is launched as a login shell, I believe.

magnus-ISU commented 2 years ago

Or maybe just not reset in general huh

doron-cohen commented 2 years ago

@magnus-ISU I won't be able to work on this project for the next 2 weeks. I am sorry for any delays in PR reviews and merges, hope I can get to merge it all and release a new version with some cool features I am planning.

magnus-ISU commented 2 years ago

No problem and sounds good! My PR did change quite a bit of some of the code so its probably best to merge it before you start work on those new features assuming you haven't already, otherwise there might be some conflicts. But thanks for making this software, I do think it is good that it exists.

NoelJacob commented 2 years ago

I removed = from the text generated by antidot init on fish and it worked. Edit: like set -x VAR "/home/value"