-
Notifications
You must be signed in to change notification settings - Fork 60
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
Fixup parameter expansions #123
base: master
Are you sure you want to change the base?
Conversation
It is possible that one's home directory path contains spaces, this patch fixes all REALHOME expansions by wrapping them with double quotes. Signed-off-by: 林博仁(Buo-ren Lin) <Buo.Ren.Lin@gmail.com>
03fa232
to
a272ce4
Compare
It is possible that one's home directory path contains spaces, this patch fixes all SNAP_USER_{DATA,COMMON} expansions by wrapping them with double quotes. Signed-off-by: 林博仁(Buo-ren Lin) <Buo.Ren.Lin@gmail.com>
a272ce4
to
a4c8020
Compare
Signed-off-by: 林博仁(Buo-ren Lin) <Buo.Ren.Lin@gmail.com>
20e9ad0
to
998f96a
Compare
This patch quotes all non-necessary parameter expansions to help catch-up future word-splitting-prone expansions using ShellCheck. Signed-off-by: 林博仁(Buo-ren Lin) <Buo.Ren.Lin@gmail.com>
998f96a
to
09ca026
Compare
This is functionally equivalent, but wouldn't it be more readable to have:
instead of:
|
In fact, I do previously preferred the 1st style but changed my mind during generating these patches due to the search&replace friendliness and well, they are indeed functionally equivalent. I'll switch the style soon if people felt comfortable about it. |
That's not a requirement from my end, rather a mere suggestion. |
Another argument is that word splitting simply doesn't happen at the external portions of the quoting, quoting them might give viewers a false impression of the quoting in bash scripting in general and abusing it unnecessarily. But again this argument did appear during the generation of these patches, so comments are welcome. |
It is possible that one's home directory path contains spaces, this patch fixes most affected expansions by wrapping them with double quotes.
This PR also includes a patch to apply quoting to all parameter expansions, to help avoid alike failures in the future.
Signed-off-by: 林博仁(Buo-ren Lin) Buo.Ren.Lin@gmail.com