forked from jcf/git-tmbundle
/
Update Git Bundle.tmCommand
46 lines (40 loc) · 1.01 KB
/
Update Git Bundle.tmCommand
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
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>beforeRunningCommand</key>
<string>nop</string>
<key>command</key>
<string>#!/usr/bin/env ruby
require ENV['TM_BUNDLE_SUPPORT'] + '/environment.rb'
require 'erb'
include ERB::Util
g = SCM::Git.new
Dir.chdir(ENV['TM_BUNDLE_PATH'])
puts <<-EOF
<html>
<head>
<title>Update Git Bundle</title>
</head>
<body>
EOF
puts "<h2>Updating git bundle</h2>"
flush
puts " <pre>"
puts g.with_path(ENV['TM_BUNDLE_PATH']).command("pull")
puts <<-EOF
</pre>
</body>
</html>
EOF
%x{osascript -e 'tell app "TextMate" to reload bundles'}</string>
<key>input</key>
<string>none</string>
<key>name</key>
<string>Update Git Bundle</string>
<key>output</key>
<string>showAsHTML</string>
<key>uuid</key>
<string>9EAEC1C1-9979-4DB8-9877-A619580412AA</string>
</dict>
</plist>