Skip to content

Commit

Permalink
Merge pull request #34 from Rich-Harris/fix-use-tar
Browse files Browse the repository at this point in the history
Use tar module
  • Loading branch information
Sven SAULEAU authored Dec 11, 2017
2 parents b2c3ed7 + d4bd42a commit c8e3b44
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 106 deletions.
155 changes: 54 additions & 101 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@
"sander": "^0.6.0",
"semver": "^5.3.0",
"serve-favicon": "^2.4.2",
"tar": "^3.1.5",
"tar.gz": "^1.0.5",
"tar": "^3.2.1",
"uglify-js": "^3.0.25"
},
"devDependencies": {
Expand Down
12 changes: 9 additions & 3 deletions server/child-processes/create-bundle.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const path = require( 'path' );
const sander = require( 'sander' );
const child_process = require( 'child_process' );
const targz = require( 'tar.gz' );
const tar = require( 'tar' );
const request = require( 'request' );
const browserify = require( 'browserify' );
const rollup = require( 'rollup' );
Expand Down Expand Up @@ -81,7 +81,13 @@ function fetchAndExtract ( pkg, version, dir ) {

if ( !timedout ) {
info( `[${pkg.name}] extracting to ${dir}/package` );
targz().extract( `${dir}/package.tgz`, dir ).then( fulfil, reject );

tar
.x({
file: `${dir}/package.tgz`,
cwd: dir,
})
.then( fulfil, reject );
}
});
});
Expand All @@ -96,7 +102,7 @@ function sanitizePkg ( cwd ) {
function installDependencies ( cwd ) {
const pkg = require( `${cwd}/package.json` );

const envVariables = npmInstallEnvVars.join(" ")
const envVariables = npmInstallEnvVars.join(" ");
const installCommand = `${envVariables} ${root}/node_modules/.bin/npm install --production`;

info( `[${pkg.name}] running ${installCommand}` );
Expand Down

0 comments on commit c8e3b44

Please sign in to comment.