forked from pantsel/konga
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from leobeckp/sails-upgrade
Sails upgrade
- Loading branch information
Showing
69 changed files
with
25,984 additions
and
7,751 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,82 +1,23 @@ | ||
/** | ||
* Gruntfile | ||
* | ||
* This Node script is executed when you run `grunt` or `sails lift`. | ||
* It's purpose is to load the Grunt tasks in your project's `tasks` | ||
* folder, and allow you to add and remove tasks as you see fit. | ||
* For more information on how this works, check out the `README.md` | ||
* file that was generated in your `tasks` folder. | ||
* This Node script is executed when you run `grunt`-- and also when | ||
* you run `sails lift` (provided the grunt hook is installed and | ||
* hasn't been disabled). | ||
* | ||
* WARNING: | ||
* Unless you know what you're doing, you shouldn't change this file. | ||
* Check out the `tasks` directory instead. | ||
* Check out the `tasks/` directory instead. | ||
* | ||
* For more information see: | ||
* https://sailsjs.com/anatomy/Gruntfile.js | ||
*/ | ||
module.exports = function(grunt) { | ||
|
||
module.exports = function(grunt) { | ||
|
||
|
||
// Load the include-all library in order to require all of our grunt | ||
// configurations and task registrations dynamically. | ||
var includeAll; | ||
try { | ||
includeAll = require('include-all'); | ||
} catch (e0) { | ||
try { | ||
includeAll = require('sails/node_modules/include-all'); | ||
} catch (e1) { | ||
console.error('Could not find `include-all` module.'); | ||
console.error('Skipping grunt tasks...'); | ||
console.error('To fix this, please run:'); | ||
console.error('npm install include-all --save`'); | ||
console.error(); | ||
|
||
grunt.registerTask('default', []); | ||
return; | ||
} | ||
} | ||
|
||
|
||
/** | ||
* Loads Grunt configuration modules from the specified | ||
* relative path. These modules should export a function | ||
* that, when run, should either load/configure or register | ||
* a Grunt task. | ||
*/ | ||
function loadTasks(relPath) { | ||
return includeAll({ | ||
dirname: require('path').resolve(__dirname, relPath), | ||
filter: /(.+)\.js$/, | ||
excludeDirs: /^\.(git|svn)$/ | ||
}) || {}; | ||
} | ||
|
||
/** | ||
* Invokes the function from a Grunt configuration module with | ||
* a single argument - the `grunt` object. | ||
*/ | ||
function invokeConfigFn(tasks) { | ||
for (var taskName in tasks) { | ||
if (tasks.hasOwnProperty(taskName)) { | ||
tasks[taskName](grunt); | ||
} | ||
} | ||
} | ||
|
||
|
||
|
||
// Load task functions | ||
var taskConfigurations = loadTasks('./tasks/config'), | ||
registerDefinitions = loadTasks('./tasks/register'); | ||
|
||
// (ensure that a default task exists) | ||
if (!registerDefinitions.default) { | ||
registerDefinitions.default = function(grunt) { | ||
grunt.registerTask('default', []); | ||
}; | ||
} | ||
var loadGruntTasks = require('sails-hook-grunt/accessible/load-grunt-tasks'); | ||
|
||
// Run task functions to configure Grunt. | ||
invokeConfigFn(taskConfigurations); | ||
invokeConfigFn(registerDefinitions); | ||
// Load Grunt task configurations (from `tasks/config/`) and Grunt | ||
// task registrations (from `tasks/register/`). | ||
loadGruntTasks(__dirname, grunt); | ||
|
||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.