diff --git a/Gruntfile.js b/Gruntfile.js
index e2d43ff3..52737344 100755
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -9,7 +9,8 @@ module.exports = function(grunt) {
grunt.registerTask("prod",
"Creates a production-ready build. Use the --msg flag to add a compile message.",
- ["jshint", "exec:stats", "clean", "jsdoc", "concat", "copy", "cssmin", "uglify:prod", "inline", "htmlmin", "chmod"]);
+ ["jshint", "exec:stats", "clean", "jsdoc", "concat", "copy:html_dev", "copy:html_prod", "copy:html_inline",
+ "copy:static_dev", "copy:static_prod", "cssmin", "uglify:prod", "inline", "htmlmin", "chmod"]);
grunt.registerTask("docs",
"Compiles documentation in the /docs directory.",
@@ -18,6 +19,10 @@ module.exports = function(grunt) {
grunt.registerTask("stats",
"Provides statistics about the code base such as how many lines there are as well as details of file sizes before and after compression.",
["concat:js", "uglify:prod", "exec:stats", "exec:repo_size", "exec:display_stats"]);
+
+ grunt.registerTask("release",
+ "Prepares and deploys a production version of CyberChef to the gh-pages branch.",
+ ["copy:gh_pages", "exec:deploy_gh_pages"]);
grunt.registerTask("default",
"Lints the code base and shows stats",
@@ -259,7 +264,7 @@ module.exports = function(grunt) {
process: function(content, srcpath) {
// TODO: Do all this in Jade
content = content.replace(
- 'Download CyberChef',
+ 'Download CyberChef',
'Compile time: ' + grunt.template.today("dd/mm/yyyy HH:MM:ss") + ' UTC');
return grunt.template.process(content, template_options);
}
@@ -275,7 +280,8 @@ module.exports = function(grunt) {
src: [
"**/*",
"**/.*",
- "!stats.txt"
+ "!stats.txt",
+ "!ga.html"
],
dest: "build/dev/"
}
@@ -289,11 +295,24 @@ module.exports = function(grunt) {
src: [
"**/*",
"**/.*",
- "!stats.txt"
+ "!stats.txt",
+ "!ga.html"
],
dest: "build/prod/"
}
]
+ },
+ gh_pages: {
+ options: {
+ process: function(content, srcpath) {
+ // Add Google Analytics code to index.html
+ content = content.replace("