Skip to content
This repository has been archived by the owner on Mar 27, 2019. It is now read-only.

Commit

Permalink
add proper binary support. Closes #10
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Aug 21, 2012
1 parent 471eb9c commit cf2253b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
1 change: 0 additions & 1 deletion index.js
@@ -1,2 +1 @@

module.exports = require('./lib/component'); module.exports = require('./lib/component');
15 changes: 8 additions & 7 deletions lib/Package.js
Expand Up @@ -154,13 +154,14 @@ Package.prototype.getFiles = function(files, fn){
var url = self.url(file); var url = self.url(file);
debug('fetching %s', url); debug('fetching %s', url);
self.emit('file', file, url); self.emit('file', file, url);
request.get(url, function(res){ var out = fs.createWriteStream(self.join(file));
if (res.ok) { request
debug('got %s', url); .get(url)
self.writeFile(file, res.text, done); .buffer(false)
} else { .end(function(res){
done(new Error('failed to fetch ' + url)); res.pipe(out);
} res.on('error', done);
res.on('end', done);
}); });
}); });
}); });
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -8,7 +8,7 @@
"term-css": "1.0.0", "term-css": "1.0.0",
"commander": "1.0.0", "commander": "1.0.0",
"mkdirp": "0.3.3", "mkdirp": "0.3.3",
"superagent": "0.6.0", "superagent": "0.8.0",
"component-builder": "0.0.1", "component-builder": "0.0.1",
"string-to-js": "0.0.1", "string-to-js": "0.0.1",
"which": "1.0.5", "which": "1.0.5",
Expand Down

0 comments on commit cf2253b

Please sign in to comment.