Created
March 14, 2012 05:28
-
-
Save atnan/2034294 to your computer and use it in GitHub Desktop.
Revisions
-
atnan created this gist
Mar 14, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ #!/usr/bin/env ruby previous_sha, current_sha, branch_checkout, _ = *ARGV exit if branch_checkout == 0 || previous_sha == current_sha begin require 'pathname' require 'fileutils' root = Pathname.new(%x( git rev-parse --show-toplevel ).strip) Pathname.glob(root.join("**", "Breakpoints.xcbkptlist")).each do |breakpoint| # Breakpoints.xcbkptlist -> .SHA-Breakpoints.xcbkptlist FileUtils.mv(breakpoint, breakpoint.dirname.join(".#{previous_sha}-#{breakpoint.basename}")) end Pathname.glob(root.join("**", ".#{current_sha}-Breakpoints.xcbkptlist")) do |breakpoint| # .SHA-Breakpoints.xcbkptlist -> Breakpoints.xcbkptlist FileUtils.mv(breakpoint, breakpoint.dirname.join("Breakpoints.xcbkptlist")) end end