From 7e5de30ee9ff26e75ceb01ffdc73da6e83157422 Mon Sep 17 00:00:00 2001 From: Chris Wanstrath <2+defunkt@users.noreply.github.com> Date: Fri, 26 Sep 2025 12:28:02 -0700 Subject: [PATCH] git sha --- app/nose/bin/env.ts | 5 +++-- app/src/config.ts | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/nose/bin/env.ts b/app/nose/bin/env.ts index 3a703da..df35c62 100644 --- a/app/nose/bin/env.ts +++ b/app/nose/bin/env.ts @@ -1,4 +1,4 @@ -import { NOSE_STARTED, NOSE_SYS, NOSE_DIR } from "@/config" +import { NOSE_STARTED, NOSE_SYS, NOSE_DIR, GIT_SHA } from "@/config" export default function () { return [ @@ -9,6 +9,7 @@ export default function () { `PWD=${process.env.PWD || "(none)"}`, `NOSE_STARTED=${NOSE_STARTED}`, `NOSE_SYS=${NOSE_SYS}`, - `NOSE_DIR=${NOSE_DIR}` + `NOSE_DIR=${NOSE_DIR}`, + `GIT_SHA=${GIT_SHA.slice(0, 8)}`, ].join("\n") } diff --git a/app/src/config.ts b/app/src/config.ts index 5266cda..6f0b58f 100644 --- a/app/src/config.ts +++ b/app/src/config.ts @@ -1,4 +1,5 @@ import { resolve, join } from "node:path" +import { $ } from "bun" export const NOSE_ICON = ` ͡° ͜ʖ ͡°` @@ -9,4 +10,5 @@ export const NOSE_DIR = resolve("..") export const NOSE_BIN = join(NOSE_DIR, "bin") export const NOSE_WWW = join(NOSE_DIR, "www") -export const NOSE_STARTED = Date.now() \ No newline at end of file +export const NOSE_STARTED = Date.now() +export const GIT_SHA = (await $`git rev-parse HEAD`.text()).trim() \ No newline at end of file