Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Refine vimball extraction code (thx to @bronson)

  • Loading branch information...
commit fe8e7a9efe7820b25b8ac2a8bd51c6a05a008c9c 1 parent 8e84cf8
@tmm1 tmm1 authored
Showing with 5 additions and 4 deletions.
  1. +5 −4 Rakefile
View
9 Rakefile
@@ -56,8 +56,9 @@ def vim_plugin_task(name, repo=nil)
current = lines.shift until current =~ /finish$/ # find finish line
while current = lines.shift
- # first line is the filename, followed by some unknown data
- file = current[/^(.+?)\s+\[\[\[(\d+)$/, 1]
+ # first line is the filename (possibly followed by garbage)
+ # some vimballs use win32 style path separators
+ path = current[/^(.+?)(\t\[{3}\d)?$/, 1].gsub '\\', '/'
# then the size of the payload in lines
current = lines.shift
@@ -68,8 +69,8 @@ def vim_plugin_task(name, repo=nil)
# install the data
Dir.chdir dir do
- mkdir_p File.dirname(file)
- File.open(file, 'w'){ |f| f.write(data) }
+ mkdir_p File.dirname(path)
+ File.open(path, 'w'){ |f| f.write(data) }
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.