-
Notifications
You must be signed in to change notification settings - Fork 40
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
Option with spaces breaks in stowrc #15
Comments
You're correct. For reference, the guilty line is this one. I suspect it would be easy to fix this using |
Actually, a simpler solution would be to specify that This would avoid a dependency on a new module for just one obscure corner case. What do you think? |
How big of a deal is adding a dependency to a core module in perl? My background is in python with "batteries included." I'd use a python standard library without hesitation, but I'm afraid I don't know if the same applies to the perl core modules. If the change to assuming one option per line is made, how can this break an existing installation with multiple options per line? I think the That said, the examples in the stow manual do only list one option per line, implying that assuming this behavior is not unreasonable. |
Well it's not a huge deal, but given that I expect most users don't even use Thanks for your useful feedback on my idea. Yes, we could certainly make it watch for multiple options per line and fail gracefully. I can't imagine anyone would want to use an option value which contains a string like |
@cledoux Sorry, I just realised that I misunderstood/misread your previous point, because I thought That said, I wonder if we should, as the simplicity of the one option per line approach sidesteps the need for more complicated quoting rules. OTOH, http://unix.stackexchange.com/questions/304830/stow-doesnt-use-the-ignore-option-given-in-the-rc-file highlighted that it's unintuitive that using
|
This was driving me crazy, but I landed on a workaround. I am posting it here in case anybody else is struggling with this. It's...awkward. If you have a better way, please share! FYI, I'm on MacOS using zsh. I am using stow to create symlinks for configuration files kept under "~/Library/Application Support/Alfred". I needed to make that bloody space work in the directory name in a local .stowrc file for specifying -d and -t options different from my $HOME .stowrc file. Using quotes, backslash, etc. all failed to work since stow puts everything in single quotes, which (in zsh at least--I'm not familiar with other shells) makes everything literal without a $ parameter in front. Even octal character notation failed, so...
And now it just works (though you might need to adapt it for whatever shell you're using). Obviously it would be nicer for stow to just not freak out over spaces in directory names, but here we are almost eight years since this issue was opened, so...hope this helps somebody out there! |
I'll gladly accept a PR. This really should be an easy change to implement. |
To be clear, based on my last comment, I think using |
The function that parses
.stowrc
files,get_config_file_options
, splits.stowrc
file on spaces. Thus, if a file path or regex has a space, the option breaks becauseget_config_file_options
treats it as two options instead of one. In order to get the correct behavior, a more complicated split function that respects escapes would need to be implemented.The text was updated successfully, but these errors were encountered: