mirror of
https://github.com/YuzuZensai/Discord-Presence-Relay.git
synced 2026-09-13 10:49:02 +00:00
🐛 fix: exclude untracked files from dirty git status
This commit is contained in:
@@ -7,7 +7,8 @@ function getCommitHash(): string {
|
|||||||
if (process.env.GITHUB_SHA) return process.env.GITHUB_SHA.slice(0, 7)
|
if (process.env.GITHUB_SHA) return process.env.GITHUB_SHA.slice(0, 7)
|
||||||
try {
|
try {
|
||||||
const hash = execSync('git rev-parse --short HEAD').toString().trim()
|
const hash = execSync('git rev-parse --short HEAD').toString().trim()
|
||||||
const dirty = execSync('git status --porcelain').toString().trim().length > 0
|
const statusOut = execSync('git status --porcelain --untracked-files=no').toString()
|
||||||
|
const dirty = statusOut.trim().length > 0
|
||||||
return dirty ? `${hash}-dirty` : hash
|
return dirty ? `${hash}-dirty` : hash
|
||||||
} catch {
|
} catch {
|
||||||
return 'unknown'
|
return 'unknown'
|
||||||
|
|||||||
Reference in New Issue
Block a user