-
Notifications
You must be signed in to change notification settings - Fork 158
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
Should now be able to handle spaces in filenames #227
base: master
Are you sure you want to change the base?
Should now be able to handle spaces in filenames #227
Conversation
@@ -386,7 +386,7 @@ public static void makeExecutable(final File file, final Log log) throws MojoExe | |||
if (file.isFile() && file.canRead() && file.canWrite() && !file.isHidden()) { | |||
// chmod +x file | |||
final int result = runCommand("chmod", new String[] { | |||
"+x", file.getPath() | |||
"+x", file.getPath().replaceAll(" ", "\\ ") |
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.
Because chmod
is called directly rather than using shell sh
additional escaping or quoting for spaces shouldn't be required.
Was this required or "added for safety" ?
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.
I seem to remember this being required.
Thanks @SteveSmith16384 I'd really prefer to avoid managing quotes as it tends to get messier and messier as additional layers are added. But as sh is used it seems it has to be managed. Did a quick check of the regex used for splitting The following comments where interesting, do we need to account for unmatched quotes?
Thinking we need to make this new version of splitting space separated values into a util function as there seem to be additional locations to potentially fix.
|
Kicking to unscheduled, since there seems to be no activity here. |
I've not been able to fully test this, as I don't use Maven NAR directly myself (only as part of a shared project). However, you might find the suggested changes useful.