Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "[build] Uses node-archive to zip/tar packages" #25326

Merged
merged 1 commit into from Nov 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -269,7 +269,6 @@
"@types/type-detect": "^4.0.1",
"@types/uuid": "^3.4.4",
"angular-mocks": "1.4.7",
"archiver": "^3.0.0",
"babel-eslint": "^9.0.0",
"babel-jest": "^23.4.2",
"backport": "4.4.1",
Expand All @@ -279,6 +278,7 @@
"chokidar": "1.6.0",
"chromedriver": "2.42.1",
"classnames": "2.2.5",
"compressing": "^1.3.1",
"dedent": "^0.7.0",
"enzyme": "3.2.0",
"enzyme-adapter-react-16": "^1.1.1",
Expand Down
16 changes: 3 additions & 13 deletions src/dev/build/tasks/create_archives_task.js
Expand Up @@ -18,20 +18,10 @@
*/

import { dirname, extname } from 'path';
import { createWriteStream } from 'fs';
import archiver from 'archiver';
import compressing from 'compressing';

import { mkdirp } from '../lib';

function compress(type, options = {}, source, destination) {
const output = createWriteStream(destination);
const archive = archiver(type, options);

archive.pipe(output);

return archive.directory(source, '.').finalize();
}

export const CreateArchivesTask = {
description: 'Creating the archives for each platform',

Expand All @@ -46,11 +36,11 @@ export const CreateArchivesTask = {

switch (extname(destination)) {
case '.zip':
await compress('zip', { zlib: { level: 9 } }, source, destination);
await compressing.zip.compressDir(source, destination);
break;

case '.gz':
await compress('tar', { gzip: true, gzipOptions: { level: 9 } }, source, destination);
await compressing.tgz.compressDir(source, destination);
break;

default:
Expand Down