Skip to content

Commit

Permalink
Merge pull request #117 from sebsebmc/main
Browse files Browse the repository at this point in the history
Show branch and git hash
  • Loading branch information
dzervas authored Jun 28, 2024
2 parents 2cbede3 + c953ff6 commit 8d631da
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions applications/web/src/components/MainDisplay.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
<Canvas>
<Scene bind:setCameraFocus />
</Canvas>
<div class="dark:text-gray-300 absolute bottom-1 right-1">{GIT_BRANCH} {GIT_HASH}</div>
</div>

<svelte:window on:mousemove={onMouseMove} on:mouseup={onMouseUp} bind:innerWidth bind:innerHeight />
5 changes: 5 additions & 0 deletions applications/web/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@ import {svelte} from "@sveltejs/vite-plugin-svelte"
import wasm from "vite-plugin-wasm"
import topLevelAwait from "vite-plugin-top-level-await"
import {base} from "./src/base"
import child_process from "node:child_process"

export default defineConfig({
base,
plugins: [svelte(), wasm(), topLevelAwait()],
define: {
GIT_HASH: JSON.stringify(child_process.execSync('git rev-parse --short=10 HEAD').toString().trim()),
GIT_BRANCH: JSON.stringify(child_process.execSync('git rev-parse --abbrev-ref HEAD').toString().trim()),
},
build: {
outDir: "dist",
target: "esnext",
Expand Down

0 comments on commit 8d631da

Please sign in to comment.