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
Hey folks! Thanks a lot for lolcommits. ❤️ It's been fun gradually watching my descent into madness over the course of various projects.
Just wanted to report a thing that's been a very mild inconvenience: When enabling lolcommits for a new repository using --enable, it doesn't wrap the option in quotation marks as it should.
Input: lolcommits --enable --device="FaceTime HD Camera"
Expected output (.git/hooks/post-commit)
#!/bin/sh
### lolcommits hook (begin) ###
if [ ! -d "$GIT_DIR/rebase-merge" ]; then
export LANG="en_GB.UTF-8"
export PATH="/Users/alex/.rbenv/versions/2.2.2/bin:/usr/local/bin:$PATH"
lolcommits --capture --device="FaceTime HD Camera"
fi
### lolcommits hook (end) ###
Actual output (.git/hooks/post-commit):
#!/bin/sh
### lolcommits hook (begin) ###
if [ ! -d "$GIT_DIR/rebase-merge" ]; then
export LANG="en_GB.UTF-8"
export PATH="/Users/alex/.rbenv/versions/2.2.2/bin:/usr/local/bin:$PATH"
lolcommits --capture --device=FaceTime HD Camera
fi
### lolcommits hook (end) ###
This causes my captures to fail by default if multiple webcams are connected, as the device just sets to FaceTime: Device "FaceTime" not found - aborting
I'd love to submit a pull request for this, but I'm a bit worried as my Ruby skillz are very rusty and wanted to make sure I get this right and do things the Ruby way. Could you possibly point me in the right direction?
Taking an educated guess, this bug might happen around here, where the hook is installed and the arguments are passed. From some quick googling it looks like this issue is down to the shell swallowing the quotation marks, so the sensible option could be to escape all the arguments. This may also fix edge cases like webcams having device names with other unescaped characters rather that aren't a space.
If I'm right in my assumptions (and please do let me know if I'm wrong!), what'd be a good Ruby-like way to escape these strings, and how is the best way to run this gem locally for testing purposes?
In any case, here's to hoping I won't end up like this:
The text was updated successfully, but these errors were encountered:
jegtnes
changed the title
Setting default device option on --enable doesn't embed wrap device in quotation marks
Setting default device option on --enable doesn't wrap device in quotation marks
Mar 9, 2016
Thanks for spotting this, it is indeed an issue, and you're correct that is the place where the args are expanded into the commit hook from the --enable command.
I might get a chance to issue a fix for this at the weekend, if not there are some instructions on how to contribute here.
Hey folks! Thanks a lot for lolcommits. ❤️ It's been fun gradually watching my descent into madness over the course of various projects.
Just wanted to report a thing that's been a very mild inconvenience: When enabling lolcommits for a new repository using
--enable
, it doesn't wrap the option in quotation marks as it should.Input:
lolcommits --enable --device="FaceTime HD Camera"
Expected output (.git/hooks/post-commit)
Actual output (.git/hooks/post-commit):
This causes my captures to fail by default if multiple webcams are connected, as the device just sets to FaceTime:
Device "FaceTime" not found - aborting
I'd love to submit a pull request for this, but I'm a bit worried as my Ruby skillz are very rusty and wanted to make sure I get this right and do things the Ruby way. Could you possibly point me in the right direction?
Taking an educated guess, this bug might happen around here, where the hook is installed and the arguments are passed. From some quick googling it looks like this issue is down to the shell swallowing the quotation marks, so the sensible option could be to escape all the arguments. This may also fix edge cases like webcams having device names with other unescaped characters rather that aren't a space.
If I'm right in my assumptions (and please do let me know if I'm wrong!), what'd be a good Ruby-like way to escape these strings, and how is the best way to run this gem locally for testing purposes?
In any case, here's to hoping I won't end up like this:
The text was updated successfully, but these errors were encountered: