exports.init = function(grunt) {
    'use strict';

    var requirejs = require('requirejs');
    //project file paths
    var settingsFileName = 'settings.js';
    var requireConfigPath = options.projectPath + 'jam/require.config.js';

    //recursively searches the project folder for a matching settings file
    function getSettingsFilePath() {
        var settingsPath;
        // Guess settingsPath
        if (grunt.file.exists(settingsFileName)) {
            settingsPath = settingsFileName;
        } else {
            var found = grunt.file.expand('*/' + settingsFileName)
            if (found.length) {
                settingsPath = found[0];
            }
        }
        return settingsPath;
    }

    function getSettingsModule() {
        //get settings Path and check valid
        var settingsPath = getSettingsFilePath();
        if (grunt.file.exists(settingsPath)) {
            grunt.log.writeln('Using ' + settingsPath);
        } else {
            //exit with task error
            grunt.warn('Cant find ' + settingsFileName, 3);
        }
        var settings = requirejs(settingsPath);
        return settings;
    };

    function getModulePaths(settings) {
        // Get requireJS config to be able to resolve module paths.
        var config;
        if (grunt.file.exists(requireConfigPath)) {
            //use the require config generated by jam
            config = require(requireConfigPath);
            requirejs.config(config);
        } else {
            //this is an old non-jam project?
            config = {
                'paths': {
                    'lib': '../lib',
                    'lodash': '../lib/require-underscore/underscore'
                }
            };
        }
        requirejs.config(config);

       //Find the text files in all requireJS modules
        var root_len = requirejs.toUrl('').replace(/.js$/, '').length;
        //returns the relative module path to the requireJS root path
        function modulePath(moduleName) {
            var modulePath = requirejs.toUrl(moduleName).replace(/.js$/, '').substr(root_len);
            return modulePath;
        };

        //turn settings.DATA_DIRS into array of modules with paths
        var modulePaths = settings.DATA_DIRS.map(function (moduleName) {
            return {
                name: moduleName,
                path modulePaths(moduleName)
            }
        });

        return modulePaths;
    }

    var settings = getSettingsModule();
    settings.modulePaths = getModulePaths(settings);

    return settings;
};

@@ -1771,16 +1771,17 @@
 %0A       
+ 
 //Find t

fix indentation