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

Commit

Permalink
extract: use the extraction utility that was already written
Browse files Browse the repository at this point in the history
  • Loading branch information
zkat committed Feb 3, 2017
1 parent 101d614 commit 45bb11f
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions extract.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
var cache = require('./lib/cache')
var gunzip = require('./lib/util/gunzip-maybe')
var extractStream = require('./lib/util/extract-stream')
var pipe = require('mississippi').pipe
var pipeline = require('mississippi').pipeline
var optCheck = require('./lib/util/opt-check')
var rps = require('realize-package-specifier')
var tar = require('tar-fs')

module.exports = extract
function extract (spec, dest, opts, cb) {
Expand All @@ -13,12 +11,7 @@ function extract (spec, dest, opts, cb) {
opts = null
}
opts = optCheck(opts)
var xtractor = pipeline(gunzip(), tar.extract(dest, {
map: function (header) {
header.name = header.name.replace(/^package\//, '')
return header
}
}))
var xtractor = extractStream(dest, opts)
var caStream = cache.get.stream.byDigest(opts.cache, opts.digest, opts)
if (opts.digest) {
opts.log.silly('extract', 'trying from digest:', opts.digest)
Expand Down

0 comments on commit 45bb11f

Please sign in to comment.