File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import { useImport } from './sections/Import';
15
15
import { ImportWallet } from './sections/ImportWallet' ;
16
16
import { useWallets } from './stores/db/Wallets' ;
17
17
18
+ declare var __COMMIT_HASH__ : string
18
19
19
20
export function App ( ) {
20
21
const importModal = useImport ( )
@@ -112,7 +113,9 @@ export function App() {
112
113
/>
113
114
< Box mt = "auto" />
114
115
< Box >
115
- < Text size = "sm" c = "dimmed" > Source</ Text >
116
+ < Text size = "sm" c = "dimmed" >
117
+ Version: 0x{ __COMMIT_HASH__ || "Development mode" }
118
+ </ Text >
116
119
< Text
117
120
size = "sm"
118
121
c = "dimmed"
Original file line number Diff line number Diff line change 1
1
import { defineConfig } from 'vite'
2
2
import 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
3
8
4
- // https://vitejs.dev/config/
5
9
export default defineConfig ( ( { mode } : { mode : string } ) => ( {
6
10
plugins : [ react ( ) ] ,
7
11
base : mode === 'production' ? '/enchanter/' : '/' ,
12
+ define : {
13
+ __COMMIT_HASH__ : JSON . stringify ( fullCommitHash )
14
+ }
8
15
} ) )
You can’t perform that action at this time.
0 commit comments