(dir, files)
| 28 | } |
| 29 | |
| 30 | function tarballBuffer(dir, files) { |
| 31 | return new Promise((resolve, reject) => { |
| 32 | const chunks = []; |
| 33 | tar |
| 34 | .create({cwd: dir, gzip: true, portable: true, prefix: 'package/'}, files) |
| 35 | .on('data', c => chunks.push(c)) |
| 36 | .on('end', () => resolve(Buffer.concat(chunks))) |
| 37 | .on('error', reject); |
| 38 | }); |
| 39 | } |
| 40 | |
| 41 | async function seedOne(storagePath, location) { |
| 42 | const dir = path.resolve(process.cwd(), location); |