Merge branch 'master' of https://github.com/janeklb/moodle
authorAndrew Nicols <andrew@nicols.co.uk>
Tue, 12 Jan 2016 07:57:36 +0000 (15:57 +0800)
committerDan Poltawski <dan@moodle.com>
Tue, 12 Jan 2016 09:31:09 +0000 (09:31 +0000)
Gruntfile.js

index 665bb44..3dd3ef0 100644 (file)
@@ -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: {
@@ -222,7 +223,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!.