hadley/devtools — pull request #356 by jmcphers (2013-10-15 18:41:43+00:00)
Title: Look for the topmost folder after decompressing a file

When decompressing, the output folder is considered to be the folder in which the first file in the archive resides. However, for some archives, the first file in the archive does not reside in the topmost folder (e.g. consider a package which was zipped up without having `.git` removed; `package/.git/description` is treated as the package's description if it is packed first, even if `package/DESCRIPTION` exists).

This change selects the path in the archive with the fewest separators ("/") to use as the base for the output folder.