diff --git a/Gruntfile.js b/Gruntfile.js index 6f87b2a69a..475701b803 100755 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -89,6 +89,8 @@ module.exports = function (grunt) { const compileYear = grunt.template.today("UTC:yyyy"), compileTime = grunt.template.today("UTC:dd/mm/yyyy HH:MM:ss") + " UTC", pkg = grunt.file.readJSON("package.json"), + version = process.env.GITHUB_SHA || `v${pkg.version}`, + downloadZipFilename = `CyberChef_${version}.zip`, webpackConfig = require("./webpack.config.js"), BUILD_CONSTANTS = { COMPILE_YEAR: JSON.stringify(compileYear), @@ -129,7 +131,9 @@ module.exports = function (grunt) { chunks: ["main"], compileYear: compileYear, compileTime: compileTime, - version: pkg.version, + version: version, + latestReleaseVersion: pkg.version, + downloadZipFilename: downloadZipFilename, minify: { removeComments: true, collapseWhitespace: true, @@ -245,7 +249,7 @@ module.exports = function (grunt) { "!build/prod/index.html", "!build/prod/BundleAnalyzerReport.html", ], - dest: `build/prod/CyberChef_v${pkg.version}.zip` + dest: `build/prod/${downloadZipFilename}` } }, connect: { @@ -333,12 +337,12 @@ module.exports = function (grunt) { switch (process.platform) { case "darwin": return chainCommands([ - `shasum -a 256 build/prod/CyberChef_v${pkg.version}.zip | awk '{print $1;}' > build/prod/sha256digest.txt`, + `shasum -a 256 build/prod/${downloadZipFilename} | awk '{print $1;}' > build/prod/sha256digest.txt`, `sed -i '' -e "s/DOWNLOAD_HASH_PLACEHOLDER/$(cat build/prod/sha256digest.txt)/" build/prod/index.html` ]); default: return chainCommands([ - `sha256sum build/prod/CyberChef_v${pkg.version}.zip | awk '{print $1;}' > build/prod/sha256digest.txt`, + `sha256sum build/prod/${downloadZipFilename} | awk '{print $1;}' > build/prod/sha256digest.txt`, `sed -i -e "s/DOWNLOAD_HASH_PLACEHOLDER/$(cat build/prod/sha256digest.txt)/" build/prod/index.html` ]); } diff --git a/src/web/html/index.html b/src/web/html/index.html index 335f8c44ed..6ce8dd9a92 100755 --- a/src/web/html/index.html +++ b/src/web/html/index.html @@ -868,15 +868,15 @@ Be aware that the standalone version will never update itself, meaning it will not receive bug fixes or new features until you re-download newer versions manually.

-
CyberChef v<%= htmlWebpackPlugin.options.version %>
+
CyberChef <%= htmlWebpackPlugin.options.version %>
- Download ZIP file + Download ZIP file