1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | const fs = require("fs-extra");
|
4 | const path_1 = require("./path");
|
5 | const deps = {
|
6 | m: {},
|
7 | get tar() { return this.m.tar = this.m.tar || require('tar-fs'); },
|
8 | };
|
9 | exports.tar = {
|
10 | gz: {
|
11 | pack(from, to, options = {}) {
|
12 | const _from = path_1.join(from);
|
13 | const _to = path_1.join(to);
|
14 | return new Promise((resolve, reject) => {
|
15 | deps.tar
|
16 | .pack(_from, options)
|
17 | .pipe(fs.createWriteStream(_to))
|
18 | .on('error', reject)
|
19 | .on('finish', resolve);
|
20 | });
|
21 | }
|
22 | }
|
23 | };
|