Skip to content
Browse files

[NEW] Apply Patch to Arbitrary Files command.

git-svn-id: http://svn.textmate.org/trunk/Bundles/Diff.tmbundle@4662 dfb7d73b-c2ec-0310-8fea-fb051d288c6d
  • Loading branch information...
1 parent e144882 commit 267aa0d1dd7780b90f7823e557c7379d9fa6bd7f Chris Thomas committed Aug 10, 2006
Showing with 42 additions and 1 deletion.
  1. +36 −0 Commands/Apply Patch.tmCommand
  2. +6 −1 info.plist
View
36 Commands/Apply Patch.tmCommand
@@ -0,0 +1,36 @@
+<?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>beforeRunningCommand</key>
+ <string>nop</string>
+ <key>command</key>
+ <string># patch may be the most brainfucked standard Unix tool ever. Make sure it doesn't try to access the network (it tends to ignore the -g option, I find) -- if you have Perforce installed, this can be a huge performance hit -- and it touches the network even for files that aren't controlled by Perforce. All files on the system get the lovely 'is this file locked'? treatment. Software tools, huh?
+
+export PATCH_GET=0
+
+path=$(osascript&lt;&lt;END
+tell application "TextMate"
+ set theFile to choose folder with prompt "Where should I look for files to be patched?"
+ set the result to POSIX path of theFile
+end tell
+END)
+
+if [[ -z $path ]]; then
+ exit_discard
+else
+ patch -d "$path" &lt; "$TM_FILEPATH"
+fi
+</string>
+ <key>input</key>
+ <string>document</string>
+ <key>keyEquivalent</key>
+ <string>^@D</string>
+ <key>name</key>
+ <string>Apply Patch to Files…</string>
+ <key>output</key>
+ <string>showAsTooltip</string>
+ <key>uuid</key>
+ <string>54D1CEF2-10AB-407B-AAB2-6AEA06B297B1</string>
+</dict>
+</plist>
View
7 info.plist
@@ -18,7 +18,10 @@
<string>------------------------------------</string>
<string>239E196A-7106-4DC9-8FAE-0A9CA7540AFA</string>
<string>------------------------------------</string>
- <string>9297CB2A-ABFD-45F8-85F5-B737588FB9F9</string>
+ <string>4050A252-C604-4D0C-8545-E50B22E2715B</string>
+ <string>B9091553-4317-415E-B381-4609BD453E01</string>
+ <string>------------------------------------</string>
+ <string>54D1CEF2-10AB-407B-AAB2-6AEA06B297B1</string>
</array>
<key>submenus</key>
<dict/>
@@ -30,9 +33,11 @@
<string>674E54F5-065E-4224-9626-673903B7C0E0</string>
<string>0979659D-126E-467F-AC07-599979A42D67</string>
<string>D04AFBD3-8110-11D9-8E5B-0011242E4184</string>
+ <string>4050A252-C604-4D0C-8545-E50B22E2715B</string>
<string>6A811265-81DC-11D9-9AA2-000D9332809C</string>
<string>239E196A-7106-4DC9-8FAE-0A9CA7540AFA</string>
<string>B9091553-4317-415E-B381-4609BD453E01</string>
+ <string>54D1CEF2-10AB-407B-AAB2-6AEA06B297B1</string>
<string>7E848FF4-708E-11D9-97B4-0011242E4184</string>
<string>7D036841-43BD-49CA-892F-0A6837EF8FB7</string>
<string>FFF345C5-D3B4-4975-A610-69CC645FEE7C</string>

0 comments on commit 267aa0d

Please sign in to comment.
Something went wrong with that request. Please try again.