Skip to content

Commit

Permalink
install libc6 or glibc onto host
Browse files Browse the repository at this point in the history
  • Loading branch information
TheTechsTech committed Feb 4, 2018
1 parent 21eba79 commit b59616c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
10 changes: 9 additions & 1 deletion installer.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,15 @@ function platformUnpacker(source, destination){
const extract = decompress(source, destination);
extract.on('file', (name) => { if ( whattocopy.indexOf(path.basename(name)) > 0) console.log(name); });
extract.on('error', (error) => { return reject(error); });
extract.on('end', () => { resolve('linux'); });
extract.on('end', () => {
const system_installer = require('system-install');
const cmd = system_installer().split(" ")[0];
const args = [ system_installer().split(" ")[1] ];
const distro = args.concat(['install','-y']).concat(((system_installer().split(" ")[1] == 'yum') || (system_installer().split(" ")[1] == 'dnf')) ? ['glibc.i686'] : ['libc6-i386']);
console.log(cmd + ' ' + distro);
spawn.sync(cmd, distro, { stdio: 'pipe' });
resolve('linux');
});
}
});
}
Expand Down
11 changes: 8 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"scripts": {
"coverage": "istanbul cover node_modules/mocha/bin/_mocha --dir .tmp/coverage",
"coveralls": "npm install coveralls && cat .tmp/coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",
"prepack": "node binarybuilder",
"install": "node installer"
"prepack": "node binarybuilder.js",
"install": "node installer.js"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -57,10 +57,15 @@
"xar": "^1.1.1",
"unpack-all": "github:techno-express/node-unpack-all",
"macos-release": "^1.1.0",
"retrying-promise": "^0.0.4"
"retrying-promise": "^0.0.4",
"system-install": "^1.0.4",
"unpack-all": "github:techno-express/node-unpack-all",
"when": "^3.7.8",
"xar": "^1.1.1"
},
"devDependencies": {
"chai": "^3.5.0",
"fs-extra": "^5.0.0",
"istanbul": "^0.4.5",
"mocha": "^3.2.0"
}
Expand Down

0 comments on commit b59616c

Please sign in to comment.