diff options
| author | Leonardo Bishop <me@leonardobishop.com> | 2025-01-22 02:09:56 +0000 |
|---|---|---|
| committer | Leonardo Bishop <me@leonardobishop.com> | 2025-01-22 02:09:56 +0000 |
| commit | 850affbd55fee9cd48a82ade94a3a5e60fd737a8 (patch) | |
| tree | 3d53005a151f17bdef27afcfaeec91aa1217a25e /nuxt.config.ts | |
| parent | c6a34e6f7d6c0f592b8e370ee942017d914662bd (diff) | |
Add version and some icons
Diffstat (limited to 'nuxt.config.ts')
| -rw-r--r-- | nuxt.config.ts | 16 |
1 files changed, 14 insertions, 2 deletions
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 +}); |
