diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml
index a25707e21..0f600de0b 100644
--- a/.github/workflows/website.yml
+++ b/.github/workflows/website.yml
@@ -212,6 +212,19 @@ jobs:
else
echo 'const WASM_COMMANDS = ["grep"];' > "$commands_js"
fi
+ # Record the grep commit used to build its WASM module so the
+ # playground can show it alongside the coreutils build.
+ grep_hash=$(git rev-parse HEAD)
+ grep_short=$(git rev-parse --short HEAD)
+ grep_date=$(git show -s --format=%cI HEAD)
+ {
+ echo "const UUTILS_GREP_VERSION = {"
+ echo " commit: \"${grep_hash}\","
+ echo " short: \"${grep_short}\","
+ echo " date: \"${grep_date}\""
+ echo "};"
+ } >> ../uutils.github.io/static/wasm/version.js
+ echo "grep WASM build: ${grep_short} (${grep_date})"
fi
- name: Run Zola
diff --git a/content/playground.md b/content/playground.md
index 2c2b74641..30e7f4325 100644
--- a/content/playground.md
+++ b/content/playground.md
@@ -55,6 +55,12 @@ template = "page.html"
parts.push('Built from uutils/coreutils ' +
UUTILS_WASM_VERSION.short + ' (' + date + ')');
}
+ if (typeof UUTILS_GREP_VERSION !== "undefined") {
+ var grepDate = UUTILS_GREP_VERSION.date.split("T")[0];
+ var grepUrl = "https://github.com/uutils/grep/commit/" + UUTILS_GREP_VERSION.commit;
+ parts.push('grep ' +
+ UUTILS_GREP_VERSION.short + ' (' + grepDate + ')');
+ }
if (typeof SITE_VERSION !== "undefined") {
var siteDate = SITE_VERSION.date.split("T")[0];
var siteUrl = "https://github.com/uutils/uutils.github.io/commit/" + SITE_VERSION.commit;