From c9b6feea0e25133abf53170682488abd57a3d317 Mon Sep 17 00:00:00 2001 From: Janek Lasocki-Biczysko Date: Mon, 14 Dec 2015 16:53:12 +0000 Subject: [PATCH] MDL-52504 grunt: fixed scope of jshint when in amd directory --- Gruntfile.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index dcc22a8f34f..f6bd5e977b5 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -26,13 +26,14 @@ module.exports = function(grunt) { var path = require('path'), fs = require('fs'), tasks = {}, - cwd = process.env.PWD || process.cwd(); + cwd = process.env.PWD || process.cwd(), + inAMD = path.basename(cwd) == 'amd'; // Project configuration. grunt.initConfig({ jshint: { options: {jshintrc: '.jshintrc'}, - files: ['**/amd/src/*.js'] + files: [inAMD ? cwd + '/src/*.js' : '**/amd/src/*.js'] }, uglify: { dynamic_mappings: { @@ -218,7 +219,7 @@ module.exports = function(grunt) { if (path.basename(path.resolve(cwd, '../../')) == 'yui') { grunt.task.run('shifter'); // Are we in an AMD directory? - } else if (path.basename(cwd) == 'amd') { + } else if (inAMD) { grunt.task.run('amd'); } else { // Run them all!. -- 2.43.0