Skip to content

Commit

Permalink
[import] Use unique tempdirs when unpacking archive for import (#1292)
Browse files Browse the repository at this point in the history
  • Loading branch information
bjoerge committed May 9, 2019
1 parent dcaefe2 commit 8c5ccdc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/@sanity/import/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"peek-stream": "^1.1.2",
"split2": "^2.1.1",
"tar-fs": "^1.16.0",
"tempy": "^0.3.0",
"whatwg-url": "^7.0.0"
},
"devDependencies": {
Expand Down
3 changes: 2 additions & 1 deletion packages/@sanity/import/src/importFromStream.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ const gunzipMaybe = require('gunzip-maybe')
const peek = require('peek-stream')
const isTar = require('is-tar')
const tar = require('tar-fs')
const tempy = require('tempy')
const globby = require('globby')
const debug = require('debug')('sanity:import:stream')
const {noop} = require('lodash')
const getJsonStreamer = require('./util/getJsonStreamer')

module.exports = (stream, options, importers) =>
new Promise((resolve, reject) => {
const outputPath = path.join(os.tmpdir(), 'sanity-import')
const outputPath = path.join(tempy.directory(), 'sanity-import')
debug('Importing from stream')

let isTarStream = false
Expand Down

0 comments on commit 8c5ccdc

Please sign in to comment.