feature(rest) onPut: forEach -> RegExp

This commit is contained in:
coderaiser 2015-03-27 08:34:05 -04:00
parent ed29320b90
commit 897f0099b2

View file

@ -262,14 +262,12 @@
if (!files.from) {
callback(body);
} else {
from = mellow.pathToWin(files.from);
from = mellow.pathToWin(files.from);
if (files.to)
to = mellow.pathToWin(files.to);
to = mellow.pathToWin(files.to);
else
['.zip', '.tar.gz', '.gz'].forEach(function(str) {
to = files.from.replace(str);
});
to = files.from.replace(/(\.gz|\.tar\.gz)$/, '');
packer.unpack(from, to, function(error) {
var name = path.basename(files.from),