Skip to content

Commit

Permalink
* change line fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dudemeister committed Apr 13, 2011
1 parent 2676c5c commit e8accf3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions protonet.rb
Expand Up @@ -31,6 +31,14 @@ def version_string
end

dep 'protonet babushka update' do
def change_line line, replacement, filename
path = filename.p

log "Patching #{path}"
shell("cat > #{path}", :input => path.readlines.map {|l|
l.gsub(/^(\s*)(#{Regexp.escape(line)})/, "\\1# #{edited_by_babushka}\n\\1# was: \\2\n\\1#{replacement}")
}.join(""))
end
requires 'protonet babushka remove', 'protonet babushka'
# this is added to ensure that the upcoming babuhska migration is run correctly
if((version = shell('cat /home/protonet/dashboard/current/RELEASE')[/[0-9]*/]) && version.to_i >= 94)
Expand Down

0 comments on commit e8accf3

Please sign in to comment.