每次提交时都要拍摄自己的照片(范例)

・1 分钟阅读

https://github.com/rharder/imagesnap下载imageSnap,或者用 Homebrew安装它:

brew install imagesnap

创建~/.gitshots目录:

mkdir ~/.gitshots

将这作为post-commithook添加到你的git仓库:

 

#!/usr/bin/env ruby
file="~/.gitshots/#{Time.now.to_i}.jpg"
unless File.directory?(File.expand_path("../../rebase-merge", __FILE__))
 puts "Taking capture into #{file}!"
 system "imagesnap -q -w 3 #{file}
凉爽拍拍 profile image