mirror of
https://github.com/bower/bower.git
synced 2026-04-24 03:00:19 -04:00
Improve can extract function.
This commit is contained in:
@@ -207,7 +207,7 @@ UrlResolver.prototype._extract = function (file, response) {
|
||||
mimeType = mimeType.split(';')[0].trim();
|
||||
}
|
||||
|
||||
if (!extract.canExtract(mimeType || file)) {
|
||||
if (!extract.canExtract(file, mimeType)) {
|
||||
return Q.resolve();
|
||||
}
|
||||
|
||||
|
||||
@@ -138,8 +138,16 @@ function moveSingleDirContents(dir) {
|
||||
|
||||
// -----------------------------
|
||||
|
||||
function canExtract(target) {
|
||||
return !!getExtractor(target);
|
||||
function canExtract(src, mimeType) {
|
||||
if (getExtractor(src)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (mimeType && getExtractor(mimeType)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Available options:
|
||||
|
||||
Reference in New Issue
Block a user