Skip to content
This repository

Merge dmitris pr #542 #844

Merged
merged 3 commits into from over 1 year ago

2 participants

lzhan Isao Yagi
lzhan
Collaborator

thank you @dmitris

Dmitry Savin... and others added some commits
Isao Yagi

+1

lzhan lzhan merged commit 9f3e880 into from
lzhan lzhan closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 3 unique commits by 2 authors.

Sep 21, 2012
Dmitry Savintsev Fixed handling of bad input for mojito jslint mojit command, modified…
… the help/usage message
bfc2617
Dmitry Savintsev minor change of the wording for the error to reflect that we need the…
… path to the mojit like mojits/Bar not just its name
740af31
Dec 06, 2012
lzhan lzhan Merge remote-tracking branch 'upstream/develop' into fixlint b97968e
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 22 additions and 4 deletions. Show diff stats Hide diff stats

  1. +22 4 lib/app/commands/jslint.js
26 lib/app/commands/jslint.js
@@ -12,7 +12,15 @@ var fs = require('fs'),
12 12 path = require('path'),
13 13 existsSync = fs.existsSync || path.existsSync,
14 14 utils = require(path.join(__dirname, '../../management/utils')),
15   - usage = 'mojito jslint [app | mojit] [<name>] {options}\n' +
  15 + usage = 'mojito jslint [app | mojit] [<path>] {options}\n' +
  16 + '\t- target: app or mojit\n' +
  17 + '\t- path (required for a mojit target): the path to the mojit to run jslint on\n\n' +
  18 + 'Run jslint on the app in the current directory:\n' +
  19 + '\tmojito jslint app .\n' +
  20 + 'Run jslint on mojits/Bar:\n' +
  21 + '\tmojito jslint mojit ./mojits/Bar\n' +
  22 + 'Run jslint on the mojito framework itself!\n' +
  23 + '\tmojito jslint\n' +
16 24 '\nOPTIONS: \n' +
17 25 '\t --print : print results to stdout \n' +
18 26 '\t -p : short for --print\n',
@@ -409,6 +417,7 @@ function run(params, options) {
409 417 outDir,
410 418 failures,
411 419 errors,
  420 + mojit_path,
412 421 print = options && options.print;
413 422
414 423 // Process params to determine input and output locations.
@@ -439,13 +448,22 @@ function run(params, options) {
439 448 ];
440 449 } else if (params[0] === 'mojit') {
441 450 // mojit
442   - inDir = getMojitDir(params[1]);
  451 + mojit_path = params[1];
  452 + if (!mojit_path) {
  453 + utils.error('Please specify the path to mojit', exports.usage);
  454 + return;
  455 + }
  456 + inDir = getMojitDir(mojit_path);
  457 + if (!existsSync(inDir)) {
  458 + utils.error('Mojit ' + mojit_path + ' not found.', usage);
  459 + return;
  460 + }
443 461 if (!inDir) {
444   - utils.error('Mojit not found.', usage);
  462 + utils.error('Mojit ' + mojit_path + ' not found.', usage);
445 463 return;
446 464 }
447 465 outDir = path.join(inDir, 'artifacts/jslint/mojits',
448   - getMojitName(params[1]));
  466 + getMojitName(mojit_path));
449 467 excludes = [
450 468 /\/tests$/,
451 469 /\/artifacts$/,

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.