Skip to content

Commit

Permalink
Only get first tag on build (#859)
Browse files Browse the repository at this point in the history
  • Loading branch information
ImUrX committed Sep 29, 2023
1 parent 2bc50b2 commit 4bd31fb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
13 changes: 8 additions & 5 deletions gui/vite.config.ts
Original file line number Diff line number Diff line change
@@ -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;

Expand Down Expand Up @@ -51,7 +54,7 @@ export default defineConfig({
},
resolve: {
alias: {
'@': path.resolve(__dirname, 'src')
}
}
'@': path.resolve(__dirname, 'src'),
},
},
});
4 changes: 2 additions & 2 deletions server/desktop/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit 4bd31fb

Please sign in to comment.