-
Notifications
You must be signed in to change notification settings - Fork 258
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
Better fishfile location support #547
Better fishfile location support #547
Conversation
Per issue #545, support fishfile living in $fish_config even when $fisher_path is set if desired.
I'll leave the decision to bump the version to you this time @jorgebucaran. No README updates needed in my estimation. The only possible "breaking" behavior would be for people who have $fisher_path set different to $fish_config, have fishfiles in both locations, and are expecting the $fisher_path one to work and get surprised that the $fish_config one does. I think this is likely a non-issue. |
@jorgebucaran Sure thing. Problem Statement: However, the problem comes in if you set Placing the fishfile in the The reason someone sets their Solution
PR Breakdown
|
I do wish @Scrumplex had weighed in on #545 though, just to make sure that looking for $fisher_path/fishfile first still met his needs. |
I understand the problem now and fully agree with you @mattmc3. I'd prefer to avoid all the complications and simply default to If you can adjust your PR for that I'll merge this in a heartbeat. |
Ping @mattmc3. Any chance you could look at this? 👋 |
@jorgebucaran - Can you affirm my understanding of this statement? I interpret this to mean that you don't want the |
@mattmc3 Yes, that's why I mean. Of course, we can design temporary measures to help people transition. What do you have in mind? |
fisher.fish
Outdated
# 2019-10-22: temp code, migrates fishfile from old path back to $fish_config | ||
if test -e "$fisher_path/fishfile"; and test ! -e "$fish_config/fishfile" | ||
command mv -f "$fisher_path/fishfile" "$fish_config/fishfile" | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me know if this works for you for fishfile migration @jorgebucaran.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems alright.
@jorgebucaran - I have pushed a new, simplified commit for re-homing |
ping @jorgebucaran - any additional feedback on this? If I missed the mark on what you were hoping for let me know and I'll take another swing. |
@mattmc3 I think we're good to go. Ping @Scrumplex. |
I HAVE BEEN SUMMONED. (didn't look into this at all yet, give me a minute 😄) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. I don't really need the use-case I introduced with #480 anymore. So this change is generally welcome, as I do agree, that putting a config file at the same place as a cache is not a good idea.
Except for my comment there I approve this overall.
fisher.fish
Outdated
@@ -181,7 +187,7 @@ end | |||
function _fisher_commit -a cmd | |||
set -e argv[1] | |||
set -l elapsed (_fisher_now) | |||
set -l fishfile $fisher_path/fishfile | |||
set -l fishfile $fish_config/fishfile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's up with this? Didn't we define $fishfile
earlier in line 12?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Scrumplex - The -l
flag defines a local variable in the scope of the function, so it needs to be done in both places if we want to use locals. I could convert the one on line 12 in the main fisher
function to global (-g
). Stylistically, it's probably fine in this project to do it that way - not my typical choice to use globals this way, but if it causes heartburn to define it in two places and a global is preferred, we can do that. @jorgebucaran - do you have a preference here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Going to agree with @Scrumplex, but only if fishfile
can't change. See https://github.com/jorgebucaran/fisher/pull/547/files#r339362195.
fisher.fish
Outdated
@@ -9,6 +9,7 @@ function fisher -a cmd -d "fish package manager" | |||
set -g fisher_config $XDG_CONFIG_HOME/fisher | |||
|
|||
set -q fisher_path; or set -g fisher_path $fish_config | |||
set -l fishfile "$fish_config/fishfile" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mattmc3 If I get this right, fishfile
is defined only once and never changes again. If so, this should be -g
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Solid feedback! I pushed a new commit, which I'm real happy with how it simplifies the whole feature. One global, used everywhere $fishfile
needs referenced.
@jorgebucaran - I'm happy with this if you are. |
@jorgebucaran - Anything else I can do to help get this merged? |
@neersighted @Scrumplex Could you please update Fisher to get these changes and help me verify if things are running as they should? @mattmc3 One week later -- is everything working well for you? ;) |
@jorgebucaran - Solidly. My existing config has been rock solid, and I've walked someone through a new fish + fisher setup too since the release - no issues on my end. |
Per issue #545, support fishfile living in $fish_config even when $fisher_path is set if desired.
Implementation details:
_fishfile
function$fisher_path/fishfile
exists and$fish_config/fishfile
doesn't, then use$fisher_path/fishfile
. Otherwise use$fish_config/fishfile
.