mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 14:56:19 -04:00
fix vars in Gruntfile
This commit is contained in:
parent
d05543db30
commit
5d271687ec
1 changed files with 15 additions and 14 deletions
27
Gruntfile.js
27
Gruntfile.js
|
@ -1,7 +1,7 @@
|
||||||
var webpack = require("webpack"),
|
const webpack = require("webpack");
|
||||||
ExtractTextPlugin = require("extract-text-webpack-plugin"),
|
const ExtractTextPlugin = require("extract-text-webpack-plugin");
|
||||||
HtmlWebpackPlugin = require("html-webpack-plugin"),
|
const HtmlWebpackPlugin = require("html-webpack-plugin");
|
||||||
Inliner = require("web-resource-inliner");
|
const Inliner = require("web-resource-inliner");
|
||||||
|
|
||||||
module.exports = function (grunt) {
|
module.exports = function (grunt) {
|
||||||
grunt.file.defaultEncoding = "utf8";
|
grunt.file.defaultEncoding = "utf8";
|
||||||
|
@ -54,7 +54,7 @@ module.exports = function (grunt) {
|
||||||
|
|
||||||
|
|
||||||
// Project configuration
|
// Project configuration
|
||||||
var compileTime = grunt.template.today("dd/mm/yyyy HH:MM:ss") + " UTC",
|
const compileTime = grunt.template.today("dd/mm/yyyy HH:MM:ss") + " UTC",
|
||||||
banner = "/**\n" +
|
banner = "/**\n" +
|
||||||
"* CyberChef - The Cyber Swiss Army Knife\n" +
|
"* CyberChef - The Cyber Swiss Army Knife\n" +
|
||||||
"*\n" +
|
"*\n" +
|
||||||
|
@ -80,7 +80,7 @@ module.exports = function (grunt) {
|
||||||
* Compiles a production build of CyberChef into a single, portable web page.
|
* Compiles a production build of CyberChef into a single, portable web page.
|
||||||
*/
|
*/
|
||||||
function runInliner() {
|
function runInliner() {
|
||||||
var inlinerError = false;
|
const done = this.async();
|
||||||
Inliner.html({
|
Inliner.html({
|
||||||
relativeTo: "build/prod/",
|
relativeTo: "build/prod/",
|
||||||
fileContent: grunt.file.read("build/prod/cyberchef.htm"),
|
fileContent: grunt.file.read("build/prod/cyberchef.htm"),
|
||||||
|
@ -91,14 +91,16 @@ module.exports = function (grunt) {
|
||||||
strict: true
|
strict: true
|
||||||
}, function(error, result) {
|
}, function(error, result) {
|
||||||
if (error) {
|
if (error) {
|
||||||
console.log(error);
|
if (error instanceof Error) {
|
||||||
inlinerError = true;
|
done(error)
|
||||||
return false;
|
} else {
|
||||||
|
done(new Error(error));
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
grunt.file.write("build/prod/cyberchef.htm", result);
|
grunt.file.write("build/prod/cyberchef.htm", result);
|
||||||
|
done(true);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return !inlinerError;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
grunt.initConfig({
|
grunt.initConfig({
|
||||||
|
@ -301,7 +303,7 @@ module.exports = function (grunt) {
|
||||||
copy: {
|
copy: {
|
||||||
ghPages: {
|
ghPages: {
|
||||||
options: {
|
options: {
|
||||||
process: function (content, srcpath) {
|
process: function (content) {
|
||||||
// Add Google Analytics code to index.html
|
// Add Google Analytics code to index.html
|
||||||
content = content.replace("</body></html>",
|
content = content.replace("</body></html>",
|
||||||
grunt.file.read("src/web/static/ga.html") + "</body></html>");
|
grunt.file.read("src/web/static/ga.html") + "</body></html>");
|
||||||
|
@ -342,5 +344,4 @@ module.exports = function (grunt) {
|
||||||
test: "build/test/index.js"
|
test: "build/test/index.js"
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue