-
Notifications
You must be signed in to change notification settings - Fork 4
/
brew-auto-update.rb
49 lines (37 loc) · 1.1 KB
/
brew-auto-update.rb
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
48
49
require 'formula'
class BrewAutoUpdate < Formula
homepage 'https://github.com/petere/homebrew-auto-update/'
head 'https://github.com/petere/homebrew-auto-update.git', :branch => 'master'
depends_on 'terminal-notifier'
def install
inreplace 'bin/brew-auto-update', '/usr/local', HOMEBREW_PREFIX
prefix.install 'bin'
(bin/'brew-auto-update').chmod 0755
end
plist_options startup: false
def plist; <<EOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC -//Apple Computer//DTD PLIST 1.0//EN http://www.apple.com/DTDs/PropertyList-1.0.dtd >
<plist version="1.0">
<dict>
<key>Label</key>
<string>#{plist_name}</string>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/brew-auto-update</string>
</array>
<key>ProcessType</key>
<string>Background</string>
<key>StartInterval</key>
<integer>1800</integer>
<key>RunAtLoad</key>
<true/>
<key>StandardOutPath</key>
<string>/tmp/brew-auto-update.out</string>
<key>StandardErrorPath</key>
<string>/tmp/brew-auto-update.err</string>
</dict>
</plist>
EOS
end
end