From 6c1f0fbf34210fe4e9c9ca356d4ff55c2831b7e4 Mon Sep 17 00:00:00 2001 From: DallonF Date: Wed, 12 Sep 2012 11:32:15 -0700 Subject: [PATCH] Fixed sublime-linter with predefs, added dpd cli to make --- bin/.jshintrc | 19 +------------------ bin/dpd | 12 ++++++------ make.js | 6 ++++-- test-app/.jshintrc | 2 +- 4 files changed, 12 insertions(+), 27 deletions(-) diff --git a/bin/.jshintrc b/bin/.jshintrc index 660da2e..d71e52d 100644 --- a/bin/.jshintrc +++ b/bin/.jshintrc @@ -4,22 +4,5 @@ "proto": true, "lastsemic": true, "laxbreak": true, - "strict": false, - - "undef": true, - "browser": true, - "globals": { - - "describe": true - , "it": true - , "afterEach": true - , "beforeEach": true - - , "expect": true - - , "dpd": true - - , "chain": true - , "cleanCollection": true - } + "strict": false } \ No newline at end of file diff --git a/bin/dpd b/bin/dpd index 88983d5..1475993 100755 --- a/bin/dpd +++ b/bin/dpd @@ -14,7 +14,7 @@ var program = require('commander') , tty = require('tty') , remote = require('../lib/client/remote') , request = require('request') - , package = require('../package') + , packageInfo = require('../package') , latestversionFile = path.join(__dirname, '../.latestversion') , Deployment = require('../lib/client/deploy').Deployment , open = require('../lib/util/open'); @@ -30,7 +30,7 @@ program .option('-w, --wait', 'wait for input before exiting') .option('-d, --dashboard', 'start the dashboard immediately') .option('-o, --open', 'open in a browser') - .option('-e, --environment [env]', 'defaults to development') + .option('-e, --environment [env]', 'defaults to development'); /** * Commands @@ -70,11 +70,11 @@ function start(file) { process.chdir(path.dirname(file)); } if (test('-f', 'app.dpd')) { - console.log("starting deployd v" + package.version + "..."); + console.log("starting deployd v" + packageInfo.version + "..."); if (fs.existsSync(latestversionFile)) { var latest = fs.readFileSync(latestversionFile, 'utf-8'); - if (latest && latest !== package.version) { + if (latest && latest !== packageInfo.version) { console.log("deployd v" + latest + " is available. Use dpd-update command to install"); } } @@ -89,7 +89,7 @@ function start(file) { console.log("Failed to start MongoDB"); return stop(1); } - var options = {port: port, env: 'development', db: {host: '127.0.0.1', port: mongoPort, name: '-deployd'}} + var options = {port: port, env: 'development', db: {host: '127.0.0.1', port: mongoPort, name: '-deployd'}}; options.env = program.environment || process.env.DPD_ENV || options.env; if(options.env !== 'development') console.log('starting in %s mode', options.env); @@ -174,7 +174,7 @@ program , Keys = require('../lib/keys') , keys = new Keys(); - if (process.env["DPDAPP_PORT"]) DPDAPP_URL += ':' + process.env["DPDAPP_PORT"]; + if (process.env.DPDAPP_PORT) DPDAPP_URL += ':' + process.env.DPDAPP_PORT; keys.getLocal(function (err, key) { if(err) return console.error(err); diff --git a/make.js b/make.js index 0092035..9def46b 100644 --- a/make.js +++ b/make.js @@ -17,7 +17,7 @@ function hint(pathName, fileName) { var lastPath = process.cwd(); cd(pathName); echo("Linting " + pathName + (fileName ? ("/" + fileName) : "") + "..."); - exec('jshint ' + (fileName || '.')); + exec('jshint ' + (fileName || '.') + " --extra-ext " + fileName); echo(); cd(lastPath); } @@ -36,5 +36,7 @@ target.jshintDpdJs = function() { }; target.jshintCli = function() { - hint('bin', 'dpd'); + cp('bin/dpd', 'bin/dpd.js'); + hint('bin', 'dpd.js'); + rm('bin/dpd.js'); }; \ No newline at end of file diff --git a/test-app/.jshintrc b/test-app/.jshintrc index 660da2e..13ddc87 100644 --- a/test-app/.jshintrc +++ b/test-app/.jshintrc @@ -8,7 +8,7 @@ "undef": true, "browser": true, - "globals": { + "predef": { "describe": true , "it": true