File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import { useImport } from './sections/Import';
1515import { ImportWallet } from './sections/ImportWallet' ;
1616import { useWallets } from './stores/db/Wallets' ;
1717
18+ declare var __COMMIT_HASH__ : string
1819
1920export function App ( ) {
2021 const importModal = useImport ( )
@@ -112,7 +113,9 @@ export function App() {
112113 />
113114 < Box mt = "auto" />
114115 < Box >
115- < Text size = "sm" c = "dimmed" > Source</ Text >
116+ < Text size = "sm" c = "dimmed" >
117+ Version: 0x{ __COMMIT_HASH__ || "Development mode" }
118+ </ Text >
116119 < Text
117120 size = "sm"
118121 c = "dimmed"
Original file line number Diff line number Diff line change 11import { defineConfig } from 'vite'
22import react from '@vitejs/plugin-react-swc'
3+ import { execSync } from 'child_process' ;
4+
5+ const commitHash = execSync ( 'git rev-parse --short HEAD' ) . toString ( ) . trim ( )
6+ const isDirty = execSync ( 'git diff-index --quiet HEAD --; echo $?' ) . toString ( ) . trim ( ) !== '0'
7+ const fullCommitHash = isDirty ? `${ commitHash } (dirty)` : commitHash
38
4- // https://vitejs.dev/config/
59export default defineConfig ( ( { mode } : { mode : string } ) => ( {
610 plugins : [ react ( ) ] ,
711 base : mode === 'production' ? '/enchanter/' : '/' ,
12+ define : {
13+ __COMMIT_HASH__ : JSON . stringify ( fullCommitHash )
14+ }
815} ) )
You can’t perform that action at this time.
0 commit comments