|
|
@@ -2,7 +2,8 @@
|
|
|
|
|
|
'use strict';
|
|
|
|
|
|
-var dirtyFiles;
|
|
|
+var dirtyFiles,
|
|
|
+ ignoreList;
|
|
|
|
|
|
module.exports = {
|
|
|
checkTaskInQueue: function( grunt, task ) {
|
|
|
@@ -46,6 +47,24 @@ module.exports = {
|
|
|
grunt.config.merge( taskConfig );
|
|
|
},
|
|
|
|
|
|
+ getGitIgnore: function( grunt ) {
|
|
|
+ if ( !ignoreList ) {
|
|
|
+ ignoreList = grunt.file.read( '.gitignore' );
|
|
|
+
|
|
|
+ ignoreList = ignoreList
|
|
|
+ // Remove comment lines.
|
|
|
+ .replace( /^#.*$/gm, '' )
|
|
|
+ // Transform into array.
|
|
|
+ .split( /\n+/ )
|
|
|
+ // Remove empty entries.
|
|
|
+ .filter( function( path ) {
|
|
|
+ return !!path;
|
|
|
+ } );
|
|
|
+ }
|
|
|
+
|
|
|
+ return ignoreList;
|
|
|
+ },
|
|
|
+
|
|
|
getGitDirtyFiles: function() {
|
|
|
// Cache it, so it is executed only once when running multiple tasks.
|
|
|
if ( !dirtyFiles ) {
|