-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
47 lines (37 loc) · 1.09 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
***************************************************
* Playing a sound when a new commit has been made *
***************************************************
1. Get some sound files
2. Set-up git-sound-effect.rb
3. Clone the repository that you want to monitor for commits
4. Set-up a Git post-merge hook
5. Set-up update-soundrepo.sh that will do the git pull for you
6. Edit crontab to run the update-soundrepo.sh every 30 seconds.
***********************
* git-sound-effect.rb *
***********************
#!/usr/bin/ruby
sounds = ["~/git-commit-sound-1.wav",
"~/git-commit-sound-2.wav"]
chosen = sounds[rand(sounds.size)]
%x[ play #{chosen} > /dev/null 2>&1 ]
***********************
* Git post-merge hook *
***********************
#!/bin/sh
# echo "POST MERGE"
# Play sound if new stuff comes in
~/git-sound-effect.rb
***********************
* update-soundrepo.sh *
***********************
#!/bin/sh
export GIT_SSL_NO_VERIFY=true
cd ~/soundrepo
git pull > /dev/null 2>&1
***********
* Crontab *
***********
# m h dom mon dow command
* * * * * sleep 30; ~/update-soundrepo.sh
* * * * * ~/update-soundrepo.sh