Skip to content

Commit

Permalink
Test verifies if dist files exist
Browse files Browse the repository at this point in the history
  • Loading branch information
afonsof committed Oct 2, 2016
1 parent 00a4b97 commit 120cdea
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
9 changes: 8 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ module.exports = function (grunt) {
"dist/material-light.css": "less/style.less",
"dist/material-static.css": "less/static.less"
};

var replaceFiles = [
{src: ['dist/material-light.css'], dest: 'dist/material-light.css'},
{src: ['dist/material-static.css'], dest: 'dist/material-static.css'},
Expand All @@ -44,7 +45,7 @@ module.exports = function (grunt) {
for (var name in colors) {
var color = colors[name];

fileCreatorTask['.tmp/' + name + '.less'] = new Function ('fs', 'fd', 'done', '{\
fileCreatorTask['.tmp/' + name + '.less'] = new Function('fs', 'fd', 'done', '{\
fs.writeFileSync(fd, \'@import "../less/style";@color-primary:' + color + ';@color-link:' + color + ';\');\
done();\
}');
Expand Down Expand Up @@ -185,11 +186,17 @@ module.exports = function (grunt) {
deleteAfterEncoding: false
}
}
},

fileExists: {
scripts: Object.keys(lessFiles)
}

});

// Default task(s).
grunt.registerTask('default', ['clean', 'file-creator', 'imagemin', 'less', 'replace', 'cssmin', 'postcss']);
grunt.registerTask('test', ['default', 'fileExists']);


};
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"grunt-contrib-less": "^1.1.0",
"grunt-contrib-uglify": "^0.2.7",
"grunt-file-creator": "^0.1.3",
"grunt-file-exists": "^0.1.4",
"grunt-image-embed": "^0.3.3",
"grunt-postcss": "^0.7.2",
"grunt-replace": "^0.11.0",
Expand All @@ -42,7 +43,7 @@
"load-grunt-tasks": "^3.3.0",
"npm": "^3.4.1",
"pixrem": "^3.0.0",
"postcss-encode-base64-inlined-images": "0.0.1"
"postcss-encode-base64-inlined-images": "0.0.2"
},
"dependencies": {}
}

0 comments on commit 120cdea

Please sign in to comment.