1 diff --git a/tools/cli/main.js b/tools/cli/main.js
2 index 84f94bc..4fbda17 100644
3 --- a/tools/cli/main.js
4 +++ b/tools/cli/main.js
7 } // Now exec; we're not coming back.
11 + var fs = require('fs');
12 + var path = require("path")
13 + var Future = require("fibers/future")
14 + var srcOld = fs.readFileSync(executable, 'utf8');
15 + srcNew = srcOld.replace(/^#!\/bin\/bash/, '#!/bin/sh');
16 + if (srcOld !== srcNew) {
17 + fs.writeFileSync(executable, srcNew, 'utf8');
20 + var dir = path.dirname(executable);
21 + var interpreter = "@INTERPRETER@";
22 + var rpath = "@RPATH@";
23 + function spawnSync(/*...*/) {
24 + var args = Array.prototype.slice.call(arguments);
25 + var proc = require("child_process").spawn.apply(null, args);
26 + var future = new Future();
27 + proc.on('close', function (code) {
30 + return future.wait();
32 + function patchelf(/*...*/) {
33 + var pathParts = Array.prototype.slice.call(arguments);
34 + var p = path.join.apply(null, [dir, "dev_bundle"].concat(pathParts));
35 + spawnSync('@PATCHELF@', [
36 + "--set-interpreter",
41 + ], {stdio: 'inherit'});
43 + patchelf("bin", "node");
44 + patchelf("mongodb", "bin", "mongo");
45 + patchelf("mongodb", "bin", "mongod");
48 require('kexec')(executable, newArgv);
54 -//# sourceMappingURL=main.js.map
55 \ No newline at end of file
56 +//# sourceMappingURL=main.js.map