add cool git commit thing
This commit is contained in:
1 parent
cddb7e6aff
commit
b34d3a5854
2 files changed
+17
-2
No files matched your search
@@ -4,7 +4,7 @@
|
||||
height="40"
|
||||
>
|
||||
<div class="text-caption">
|
||||
StudSpider 0.2 (<small>5288d</small>)
|
||||
StudSpider 0.2 <small>(<a href="http://git.traps.moe/ph0sgene/studspider-status/commits/branch/master">{{ gitHash }}</a>)</small>
|
||||
</div>
|
||||
<a
|
||||
v-for="item in items"
|
||||
@@ -43,6 +43,8 @@
|
||||
<script setup>
|
||||
import { computed } from 'vue'
|
||||
|
||||
const gitHash = __GIT_COMMIT_HASH__
|
||||
|
||||
const copyrightYear = computed(() => {
|
||||
const currentYear = new Date().getFullYear()
|
||||
const startYear = 2025
|
||||
|
||||
+14
-1
@@ -11,9 +11,23 @@ import Vuetify, { transformAssetUrls } from 'vite-plugin-vuetify'
|
||||
// Utilities
|
||||
import { defineConfig } from 'vite'
|
||||
import { fileURLToPath, URL } from 'node:url'
|
||||
import { execSync } from 'child_process'
|
||||
|
||||
// Get git commit hash
|
||||
const getGitHash = () => {
|
||||
try {
|
||||
return execSync('git rev-parse --short HEAD').toString().trim()
|
||||
} catch (e) {
|
||||
return 'unknown'
|
||||
}
|
||||
}
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
define: {
|
||||
'__GIT_COMMIT_HASH__': JSON.stringify(getGitHash()),
|
||||
'process.env': {}
|
||||
},
|
||||
plugins: [
|
||||
VueRouter(),
|
||||
Layouts(),
|
||||
@@ -59,7 +73,6 @@ export default defineConfig({
|
||||
'unplugin-vue-router/data-loaders/basic',
|
||||
],
|
||||
},
|
||||
define: { 'process.env': {} },
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': fileURLToPath(new URL('src', import.meta.url)),
|
||||
|
||||
Reference in new issue
Block a user