summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorNathan Rajlich <nathan@tootallnate.net>2012-03-13 21:04:24 -0700
committerNathan Rajlich <nathan@tootallnate.net>2012-03-15 17:15:49 -0700
commit7cb0f5f84a2541578df8e62fcbe098108b0b8f43 (patch)
tree4fb1eca5075c94d17eca94ddd009349839a4c550 /tools
parent11d8823791644a307a7c521b08d1e213e7836885 (diff)
downloadandroid-node-v8-7cb0f5f84a2541578df8e62fcbe098108b0b8f43.tar.gz
android-node-v8-7cb0f5f84a2541578df8e62fcbe098108b0b8f43.tar.bz2
android-node-v8-7cb0f5f84a2541578df8e62fcbe098108b0b8f43.zip
install: update install.js to use `process.config`
Now that the node_prefix is available from within node, we can use it :)
Diffstat (limited to 'tools')
-rw-r--r--tools/installer.js12
1 files changed, 3 insertions, 9 deletions
diff --git a/tools/installer.js b/tools/installer.js
index 88822683fb..883f47e6d8 100644
--- a/tools/installer.js
+++ b/tools/installer.js
@@ -1,21 +1,15 @@
var fs = require('fs'),
path = require('path'),
exec = require('child_process').exec,
- options = fs.readFileSync(process.argv[2]).toString(),
- cmd = process.argv[3];
+ cmd = process.argv[2];
if (cmd !== 'install' && cmd !== 'uninstall') {
console.error('Unknown command: ' + cmd);
process.exit(1);
}
-// Python pprint.pprint() uses single quotes instead of double.
-// awful.
-options = options.replace(/'/gi, '"')
-
-// Parse options file and remove first comment line
-options = JSON.parse(options.split('\n').slice(1).join(''));
-var variables = options.variables,
+// Use the built-in config reported by the current process
+var variables = process.config.variables,
node_prefix = variables.node_prefix || '/usr/local';
// Execution queue