mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-04-06 02:01:58 +02:00
Only get first tag on build (#859)
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
import react from '@vitejs/plugin-react';
|
||||
import { defineConfig, PluginOption } from 'vite';
|
||||
import { execSync } from 'child_process';
|
||||
import path from 'path'
|
||||
import path from 'path';
|
||||
import { visualizer } from 'rollup-plugin-visualizer';
|
||||
|
||||
const commitHash = execSync('git rev-parse --verify --short HEAD').toString().trim();
|
||||
const versionTag = execSync('git --no-pager tag --points-at HEAD').toString().trim();
|
||||
const versionTag = execSync('git --no-pager tag --sort -taggerdate --points-at HEAD')
|
||||
.toString()
|
||||
.split('\n')[0]
|
||||
.trim();
|
||||
// If not empty then it's not clean
|
||||
const gitClean = execSync('git status --porcelain').toString() ? false : true;
|
||||
|
||||
@@ -51,7 +54,7 @@ export default defineConfig({
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': path.resolve(__dirname, 'src')
|
||||
}
|
||||
}
|
||||
'@': path.resolve(__dirname, 'src'),
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
@@ -81,8 +81,8 @@ buildConfig {
|
||||
packageName("dev.slimevr.desktop")
|
||||
|
||||
val gitVersionTag = providers.exec {
|
||||
commandLine("git", "--no-pager", "tag", "--points-at", "HEAD")
|
||||
}.standardOutput.asText.get()
|
||||
commandLine("git", "--no-pager", "tag", "--sort", "-taggerdate", "--points-at", "HEAD")
|
||||
}.standardOutput.asText.get().split('\n').first()
|
||||
buildConfigField("String", "GIT_COMMIT_HASH", "\"${grgit.head().abbreviatedId}\"")
|
||||
buildConfigField("String", "GIT_VERSION_TAG", "\"${gitVersionTag.trim()}\"")
|
||||
buildConfigField("boolean", "GIT_CLEAN", grgit.status().isClean.toString())
|
||||
|
||||
Reference in New Issue
Block a user