Don't fail on non-git executions

warn about this not being supported.
This commit is contained in:
Matthias 2024-07-03 19:47:50 +02:00
parent 7650b4842a
commit 0ebe6ec08b

View File

@ -8,7 +8,12 @@ import Icons from 'unplugin-icons/vite';
import Components from 'unplugin-vue-components/vite'; import Components from 'unplugin-vue-components/vite';
import { defineConfig } from 'vite'; import { defineConfig } from 'vite';
const commitHash = execSync('git rev-parse --short HEAD').toString(); let commitHash: string = 'unknown';
try {
commitHash = execSync('git rev-parse --short HEAD').toString();
} catch (error) {
console.error('Failed to get commit hash. Running in this mode will not be supported.');
}
// https://vitejs.dev/config/ // https://vitejs.dev/config/
export default defineConfig({ export default defineConfig({