Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add proper binary support. Closes #10

  • Loading branch information...
commit cf2253b42a341b272e1c60d01ac590c91fb65d6b 1 parent 471eb9c
@tj tj authored
Showing with 9 additions and 9 deletions.
  1. +0 −1  index.js
  2. +8 −7 lib/Package.js
  3. +1 −1  package.json
View
1  index.js
@@ -1,2 +1 @@
-
module.exports = require('./lib/component');
View
15 lib/Package.js
@@ -154,13 +154,14 @@ Package.prototype.getFiles = function(files, fn){
var url = self.url(file);
debug('fetching %s', url);
self.emit('file', file, url);
- request.get(url, function(res){
- if (res.ok) {
- debug('got %s', url);
- self.writeFile(file, res.text, done);
- } else {
- done(new Error('failed to fetch ' + url));
- }
+ var out = fs.createWriteStream(self.join(file));
+ request
+ .get(url)
+ .buffer(false)
+ .end(function(res){
+ res.pipe(out);
+ res.on('error', done);
+ res.on('end', done);
});
});
});
View
2  package.json
@@ -8,7 +8,7 @@
"term-css": "1.0.0",
"commander": "1.0.0",
"mkdirp": "0.3.3",
- "superagent": "0.6.0",
+ "superagent": "0.8.0",
"component-builder": "0.0.1",
"string-to-js": "0.0.1",
"which": "1.0.5",
Please sign in to comment.
Something went wrong with that request. Please try again.