You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was a bit surprised to realize that running stow from somewhere outside of my $STOW_DIR did not respect the .stowrc in $STOW_DIR. The documentation does indicate that this is expected behavior:
Stow searches for default command line options at .stowrc (current directory) and ~/.stowrc (home directory) in that order.
I feel that $STOW_DIR should be added to this list, since my understanding the point of $STOW_DIR is to let you run stow from outside of your $STOW_DIR. Of course, you can use the ~/.stowrc location (which I will start doing), but IMO the natural place to place your .stowrc is in your $STOW_DIR since it's likely version-controlled.
(Bonus suggestion: Look in ${XDG_CONFIG_HOME:-$HOME} instead of $HOME for .stowrc)
The text was updated successfully, but these errors were encountered:
This sounds like a reasonable enhancement. There is one caveat in implementing this however: $STOW_DIR/.stowrc cannot be allowed to contain the -d / --dir options. There are two reasons for this:
Stow has no way to find the Stow directory unless it's told where it is, short of scanning the entire filesystem. So $STOW_DIR/.stowrc cannot be relied on for locating the Stow directory. (And BTW there can be multiple Stow directories on a system.)
It wouldn't make sense for $STOW_DIR/.stowrc to contain --dir /path/to/a/different/stow/dir as that would lead to very surprising behaviour.
With that caveat in mind, I'd definitely welcome a PR for this. The changes to get_config_file_options in stow.in should be extremely simple. The only slightly tricky thing would be adding relevant tests to t/rc_options.t.
Regarding the bonus suggestion, making Stow also check $XDG_CONFIG_HOME if defined sounds like a good idea. Although in that case it should still fall back to checking $HOME, otherwise if $XDG_CONFIG_HOME is defined but .stowrc is in $HOME, it will get ignored. A PR for this would be very welcome and even easier to make than a PR for above (perhaps both could be done at the same time, in fact).
I was a bit surprised to realize that running
stow
from somewhere outside of my $STOW_DIR did not respect the .stowrc in $STOW_DIR. The documentation does indicate that this is expected behavior:I feel that $STOW_DIR should be added to this list, since my understanding the point of $STOW_DIR is to let you run
stow
from outside of your $STOW_DIR. Of course, you can use the ~/.stowrc location (which I will start doing), but IMO the natural place to place your .stowrc is in your $STOW_DIR since it's likely version-controlled.(Bonus suggestion: Look in
${XDG_CONFIG_HOME:-$HOME}
instead of$HOME
for .stowrc)The text was updated successfully, but these errors were encountered: