From 850affbd55fee9cd48a82ade94a3a5e60fd737a8 Mon Sep 17 00:00:00 2001 From: Leonardo Bishop Date: Wed, 22 Jan 2025 02:09:56 +0000 Subject: Add version and some icons --- nuxt.config.ts | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'nuxt.config.ts') diff --git a/nuxt.config.ts b/nuxt.config.ts index 724f521..bb1bfce 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -1,4 +1,14 @@ -// https://nuxt.com/docs/api/configuration/nuxt-config +import { execSync } from "child_process"; +let gitSha: string | null = null; +let version: string | null = null; +try { + gitSha = execSync("git rev-parse HEAD").toString().trim().substring(0, 7); + version = execSync("git log -1 --format=%cd --date=format:'%Y.%m.%d'").toString().trim(); +} catch (e) { + gitSha = "git unknown"; + version = new Date().toISOString().slice(0, 10).replace(/-/g, "."); +} + export default defineNuxtConfig({ compatibilityDate: "2024-11-01", devtools: { enabled: true }, @@ -8,6 +18,8 @@ export default defineNuxtConfig({ runtimeConfig: { public: { baseURL: process.env.BASE_URL || "/api", + gitSha: gitSha, + version: version, }, }, @@ -24,4 +36,4 @@ export default defineNuxtConfig({ }, modules: ["@pinia/nuxt", "@vite-pwa/nuxt"], -}); \ No newline at end of file +}); -- cgit v1.2.3-70-g09d2