Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make path for fishfile configurable to be separate from $fisher_path #545

Closed
mattmc3 opened this issue Jul 30, 2019 · 6 comments
Closed

Comments

@mattmc3
Copy link
Contributor

mattmc3 commented Jul 30, 2019

I keep my fish configuration in my dotfiles repo, but don't really need to keep all stuff installed via fisher there too, just the fishfile. Problem is, if you change $fisher_path, it changes where fishfile gets placed to store it in $fisher_path. I would argue that your fishfile is a separate concept than what gets installed, so fishfile should be configurable to live with the rest of your config.

So, for example, if I set $fisher_path to $XDG_DATA_HOME/fish/fisher, fishfile gets placed in $fisher_path instead of ~/.config/fish/fishfile.

I could symlink fishfile so it gets committed, but that seems like a bad solution. I saw this issue and wondered under what conditions you would accept a PR that made both these changes? I'm willing to put in the work to do the following:

  1. Change the name from fishfile to fish_bundle
  2. Add an optional variable to set $fish_bundle_path, and change the old default location from $fisher_path/fish_bundle to $fish_config/fish_bundle
  3. Migrate existing fishfiles to the new fish_bundle. You'd probably have to leave this in for a few versions while people update.

Let me know your thoughts.

@jorgebucaran
Copy link
Owner

@mattmc3 Have you read Changing the installation prefix? :)

@mattmc3
Copy link
Contributor Author

mattmc3 commented Jul 31, 2019

Hi Jorge, thanks for replying. I think you may have misread my request. I did read that section of the README and have changed my installation prefix by setting fisher_path.

However, setting the fisher_path variable also unfortunately has the side effect of also changing the location of fishfile, which I believe is undesirable. I would like to be able to configure the location of fishfile separately or in addition to the location of fisher_path with the introduction of a new fisher_bundle_path variable. Did you see my PR?

@jorgebucaran
Copy link
Owner

@mattmc3 Could you have a look at #479 & #480? They're related. I can't recall now, but I believe that's how I initially implemented Fisher.

Let me know your thoughts.

Rather than introducing a new $fisher_* variable, I'd prefer to do what you want by default. If that's not possible, then I'm probably okay with this.

@Scrumplex Ping.

@mattmc3
Copy link
Contributor Author

mattmc3 commented Jul 31, 2019

@jorgebucaran - I just read through those issues - great background! And also, shoot. It looks like my use case and @Scrumplex's are at odds. Let me think on it - there might be a way to meet both needs without introducing a variable by looking for an existing file in both places first, and then just use whichever we find. I agree with favoring convention over configuration.

If we go this path, I think you're right in that introducing a variable would only be necessary if someone were to want to put their fishfile in some random place, which I think is a low value feature. The higher value feature is to still look in $fisher_path first, and the follow that with a look at $fish_config (~/.config/fish) for the file, and then if it's not found, creating it.

So, some questions for you:

  1. This could be related to Rename fishfile to fish_plugins #524 if we wanted it to be (ie: rename fishfile to fish_bundle) but it could be a feature by itself. If I was introducing a variable, then we would want to decide on naming, but if we just change behavior I don't need to incorporate that (but still could). Thoughts?
  2. In order to not break things, would we want to favor the $fisher_path/fishfile over the $fish_config/fishfile if both exist?
  3. If I re-build this PR to not use a variable, are there other considerations you want me to incorporate?

@jorgebucaran
Copy link
Owner

I agree with favoring convention over configuration.

Glad we agree on this.

As for other considerations, leave out #524's fix or create a different PR for that, please. 🙏

For now, let's favor $fish_config/fishfile even if a $fisher_path/fishfile exists.

@mattmc3
Copy link
Contributor Author

mattmc3 commented Jul 31, 2019

@jorgebucaran : Here's the PR #547

jorgebucaran pushed a commit that referenced this issue Nov 9, 2019
* Better fishfile location support

Per issue #545, support fishfile living in $fish_config even when $fisher_path is set if desired.

* Re-home fishfile to $fish_config/fishfile

Per discussion here:
#547
#545

Fish file is returned from $fisher_path/fishfile to $fish_config/fishfile.

* Change $fishfile to global variable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants