Comments (6)
Hrm, good idea. I'll look into this, I'm not quite sure how to approach. Can you please dump the error output you get when it does this?
from lolcommits.
Well, so long as imagesnap, mplayer and CommandCam fail gracefully when there's no camera, the easiest test would be to just see if the image was saved, if not exit, if so continue.
from lolcommits.
Here is the output I see when committing without the camera attached. It appears @prydonius' approach might work well, if I'm reading it right.
kemitche@kemi-reddit:~/reddit/public$ git ci -am "Sample commit"
*** Preserving this moment in history.
/usr/lib/ruby/1.8/fileutils.rb:506:in `rename': No such file or directory - /home/kemitche/.lolcommits/public/tmpdir880/00000006.jpg or /home/kemitche/.lolcommits/public/tmp_snapshot.jpg (Errno::ENOENT)
from /usr/lib/ruby/1.8/fileutils.rb:506:in `mv'
from /usr/lib/ruby/1.8/fileutils.rb:1402:in `fu_each_src_dest'
from /usr/lib/ruby/1.8/fileutils.rb:1418:in `fu_each_src_dest0'
from /usr/lib/ruby/1.8/fileutils.rb:1400:in `fu_each_src_dest'
from /usr/lib/ruby/1.8/fileutils.rb:495:in `mv'
from /var/lib/gems/1.8/gems/lolcommits-0.1.2/lib/lolcommits.rb:91:in `capture'
from /var/lib/gems/1.8/gems/lolcommits-0.1.2/bin/lolcommits:94:in `do_capture'
from /var/lib/gems/1.8/gems/lolcommits-0.1.2/bin/lolcommits:173
from /var/lib/gems/1.8/bin/lolcommits:19:in `load'
from /var/lib/gems/1.8/bin/lolcommits:19
[lolc 4f0d613] Sample commit
1 files changed, 1 insertions(+), 0 deletions(-)
from lolcommits.
Another idea would be to use a blank image (like a lolcat), and put the commit message and sha on it so that it doesn't mess up you're lolcommit history.
And once again it would decide to use a blank image if no webcam image is saved.
from lolcommits.
I solved this by adding another post-commit hook to set LOLCOMMITS_DEVICE before firing lolcommits.
in .git/hooks/post-commit
:
export LOLCOMMITS_DEVICE="$(imagesnap -l | tail -n1)"
lolcommits --capture --stealth --fork
from lolcommits.
I think best approach here, is to quit/abort nicely (with a warning) if no camera was detected at all, or a bad LOLCOMMITS_DEVICE
has been set..
from lolcommits.
Related Issues (20)
- Include Geo location in the image metadata HOT 1
- --fork results in error with magit (emacs porcelain) HOT 2
- MiniMagick::Error - mogrify: non-conforming drawing primitive definition `path' HOT 10
- Require plugin gems from lolcommits HOT 1
- Consider releasing a 1.0.0 HOT 5
- Works but never exits HOT 17
- lolcommits fails to capture image on linux HOT 9
- Transfer this repository to the lolcommits organisation HOT 8
- Fork app commit process hangs with lolcommits enabled HOT 12
- lolcommits --devices no longer works HOT 2
- macOS 10.15 will not ship with with Ruby
- No video devices found after upgrading to catalina (OSX 10.15) HOT 7
- Linux webcam resolution HOT 4
- Terminates with error "`encode': wrong number of arguments" HOT 8
- Ability to replace the hash with a date
- Commits doesn't trigger snapshot
- lolcommits dosen't skip capture when rebasing HOT 2
- Can we release a new version HOT 4
- Availability of Apple Silicon support (arm64) HOT 1
- v0.16.4 has `undefined method rm_f' for File:Class (NoMethodError)` error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lolcommits.