robc (owner)

Revisions

gist: 217400 Download_button fork
public
Description:
Simple Ruby script to unzip all files in the current working directory
Public Clone URL: git://gist.github.com/217400.git
Embed All Files: show embed
batch_unzip #
1
2
3
4
5
6
7
8
9
10
11
12
#!/usr/bin/env ruby
# Invokes unzip for each file in a given directory
completed_files = Array.new
current_directory = Dir.getwd
 
Dir.foreach(current_directory) do |file_name|
  if (file_name.include?(".zip") && !completed_files.include?(file_name))
    system("unzip", file_name)
    completed_files << file_name
  end
end