From cec79f91c77c6ffbcb1e3783c82387c2be7453eb Mon Sep 17 00:00:00 2001 From: Farrin Reid Date: Sat, 23 Jun 2012 16:13:10 -0800 Subject: [PATCH] [fix] Changed require('util') to require('util') for compatibility with node v0.8 --- cli.js | 6 +++--- lib/config.js | 2 +- lib/git.js | 16 ++++++++-------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/cli.js b/cli.js index 80ec9b3..df227cd 100644 --- a/cli.js +++ b/cli.js @@ -1,6 +1,6 @@ #!/usr/bin/env node -var sys = require("sys"); +var util = require('util'); var no_de = require("./no.de"); var argv = process.argv.slice(2); @@ -45,7 +45,7 @@ switch(command) { params.push(false); } } else { - sys.puts("Missing arguments to create."); + util.puts("Missing arguments to create."); method = null; } break; @@ -54,5 +54,5 @@ switch(command) { if(method && no_de.commands.hasOwnProperty(method) && no_de.commands[method].call) { no_de.commands[method].apply(no_de, params); } else { - sys.puts("invalid or missing command: `no.de help` for a list of commands"); + util.puts("invalid or missing command: `no.de help` for a list of commands"); } \ No newline at end of file diff --git a/lib/config.js b/lib/config.js index 6cf3dfc..12b5354 100644 --- a/lib/config.js +++ b/lib/config.js @@ -1,5 +1,5 @@ var fs = require("fs"); -var sys = require("sys"); +var util = require('util'); var configFile = process.env.HOME + "/.no.de-config"; var config = {}; diff --git a/lib/git.js b/lib/git.js index ced4ada..3c30528 100644 --- a/lib/git.js +++ b/lib/git.js @@ -1,10 +1,10 @@ var posix = require('child_process'); -var sys = require("sys"); +var util = require('util'); exports.add_remote = function(remote, cb) { posix.exec('git remote add no.de "' + remote + '"', function(error, stdout, stderr) { if(error) { - sys.puts("Git returned: \n\t" + stderr.replace(/\n/, "\n\t")); + util.puts("Git returned: \n\t" + stderr.replace(/\n/, "\n\t")); cb && cb(false); } else { cb && cb(true); @@ -16,10 +16,10 @@ exports.get_domain = function(cb, ignore_error) { posix.exec("git config joyent.no_de.domain", function(error, stdout, stderr) { if(error) { if(ignore_error) return cb(null); - sys.puts("Git returned: \n\t" + stderr.replace(/\n/, "\n\t")); + util.puts("Git returned: \n\t" + stderr.replace(/\n/, "\n\t")); cb(null); } else if(!stdout.length) { - sys.puts("We could not find the domain for your no.de instance. Have you called create or bind yet?"); + util.puts("We could not find the domain for your no.de instance. Have you called create or bind yet?"); cb(null); } else { var hostname = stdout.replace(/\s+/, ""); @@ -31,7 +31,7 @@ exports.get_domain = function(cb, ignore_error) { exports.set_domain = function(domain, cb) { posix.exec('git config joyent.no_de.domain "' + domain + '"', function(error, stdout, stderr) { if(error) { - sys.puts("Git returned: \n\t" + stderr.replace(/\n/, "\n\t")); + util.puts("Git returned: \n\t" + stderr.replace(/\n/, "\n\t")); cb && cb(false); } else { cb && cb(true); @@ -43,10 +43,10 @@ exports.get_instanceid = function(cb, ignore_error) { posix.exec("git config joyent.no_de.instanceid", function(error, stdout, stderr) { if(error) { if(ignore_error) return cb(null); - sys.puts("Git returned: \n\t" + stderr.replace(/\n/, "\n\t")); + util.puts("Git returned: \n\t" + stderr.replace(/\n/, "\n\t")); cb(null); } else if(!stdout.length) { - sys.puts("We could not find the instanceid for your no.de instance. Have you called create or bind yet?"); + util.puts("We could not find the instanceid for your no.de instance. Have you called create or bind yet?"); cb(null); } else { var hostname = stdout.replace(/\s+/, ""); @@ -58,7 +58,7 @@ exports.get_instanceid = function(cb, ignore_error) { exports.set_instanceid = function(instanceid, cb) { posix.exec('git config joyent.no_de.instanceid "' + instanceid + '"', function(error, stdout, stderr) { if(error) { - sys.puts("Git returned: \n\t" + stderr.replace(/\n/, "\n\t")); + util.puts("Git returned: \n\t" + stderr.replace(/\n/, "\n\t")); cb && cb(false); } else { cb && cb(true);