Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #844 from lzhan/fixlint

Merge dmitris pr #542
  • Loading branch information...
commit 9f3e88073127d714f93fdaeff751d15e97996af9 2 parents 81e23d4 + b97968e
lzhan authored
Showing with 22 additions and 4 deletions.
  1. +22 −4 lib/app/commands/jslint.js
View
26 lib/app/commands/jslint.js
@@ -12,7 +12,15 @@ var fs = require('fs'),
path = require('path'),
existsSync = fs.existsSync || path.existsSync,
utils = require(path.join(__dirname, '../../management/utils')),
- usage = 'mojito jslint [app | mojit] [<name>] {options}\n' +
+ usage = 'mojito jslint [app | mojit] [<path>] {options}\n' +
+ '\t- target: app or mojit\n' +
+ '\t- path (required for a mojit target): the path to the mojit to run jslint on\n\n' +
+ 'Run jslint on the app in the current directory:\n' +
+ '\tmojito jslint app .\n' +
+ 'Run jslint on mojits/Bar:\n' +
+ '\tmojito jslint mojit ./mojits/Bar\n' +
+ 'Run jslint on the mojito framework itself!\n' +
+ '\tmojito jslint\n' +
'\nOPTIONS: \n' +
'\t --print : print results to stdout \n' +
'\t -p : short for --print\n',
@@ -409,6 +417,7 @@ function run(params, options) {
outDir,
failures,
errors,
+ mojit_path,
print = options && options.print;
// Process params to determine input and output locations.
@@ -439,13 +448,22 @@ function run(params, options) {
];
} else if (params[0] === 'mojit') {
// mojit
- inDir = getMojitDir(params[1]);
+ mojit_path = params[1];
+ if (!mojit_path) {
+ utils.error('Please specify the path to mojit', exports.usage);
+ return;
+ }
+ inDir = getMojitDir(mojit_path);
+ if (!existsSync(inDir)) {
+ utils.error('Mojit ' + mojit_path + ' not found.', usage);
+ return;
+ }
if (!inDir) {
- utils.error('Mojit not found.', usage);
+ utils.error('Mojit ' + mojit_path + ' not found.', usage);
return;
}
outDir = path.join(inDir, 'artifacts/jslint/mojits',
- getMojitName(params[1]));
+ getMojitName(mojit_path));
excludes = [
/\/tests$/,
/\/artifacts$/,
Please sign in to comment.
Something went wrong with that request. Please try again.