From e398a77336638ffb12b8dc67791e918be86ea857 Mon Sep 17 00:00:00 2001 From: psyirius Date: Wed, 21 Aug 2024 04:28:09 -0700 Subject: [PATCH] update --- Compile.ps1 | 4 ++-- scripts/main.ps1 | 4 ++-- scripts/start.ps1 | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Compile.ps1 b/Compile.ps1 index e95056fc..6f08c0fc 100644 --- a/Compile.ps1 +++ b/Compile.ps1 @@ -57,13 +57,13 @@ $script_content.Add($header) Update-Progress "Adding: Version" 10 $commitHash = (git rev-parse HEAD).Substring(0,16) -$gitStatus = (git status --porcelain).Trim() +$gitDirty = !([string]::IsNullOrEmpty($(git status --porcelain))) $scriptPrelude = $(Get-Content "$workingdir\scripts\start.ps1") $scriptPrelude = $scriptPrelude -replace '#{replaceme-version}', "$(Get-Date -Format yy.MM.dd)" $scriptPrelude = $scriptPrelude -replace '#{replaceme-commit}', "$commitHash" -$scriptPrelude = $scriptPrelude -replace '#{replaceme-gitstat}', "$gitStatus" +$scriptPrelude = $scriptPrelude -replace '#{replaceme-gitdirty}', ($gitDirty.ToString()) $script_content.Add($scriptPrelude) diff --git a/scripts/main.ps1 b/scripts/main.ps1 index 2da8bff1..7e78fd46 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -157,7 +157,7 @@ $sync["Form"].TaskbarItemInfo = New-Object System.Windows.Shell.TaskbarItemInfo Set-WinUtilTaskbaritem -state "None" # Set the titlebar -$sync["Form"].title = $sync["Form"].title + " " + $sync.version + " " + $sync.commit + " " + $sync.gitstat +$sync["Form"].title = $sync["Form"].title + " " + $sync.version + " " + $sync.commit + $(if ($sync.gitdirty) { " (dirty)" }) # Set the commands that will run when the form is closed $sync["Form"].Add_Closing({ $sync.runspace.Dispose() @@ -494,7 +494,7 @@ Runspace : @DeveloperDurp MicroWin : @KonTy GitHub : ChrisTitusTech/winutil Version : $($sync.version) -Commit : $($sync.commit) ($($sync.gitstat)) +Commit : $($sync.commit)$($(if ($sync.gitdirty) { " (dirty)" })) "@ $FontSize = $sync.configs.themes.$ctttheme.CustomDialogFontSize $HeaderFontSize = $sync.configs.themes.$ctttheme.CustomDialogFontSizeHeader diff --git a/scripts/start.ps1 b/scripts/start.ps1 index 9d20bcd5..cba1a028 100644 --- a/scripts/start.ps1 +++ b/scripts/start.ps1 @@ -42,7 +42,7 @@ $sync = [Hashtable]::Synchronized(@{}) $sync.PSScriptRoot = $PSScriptRoot $sync.version = "#{replaceme-version}" $sync.commit = "#{replaceme-commit}" -$sync.gitstat = "#{replaceme-gitstat}" +$sync.gitdirty = [System.Convert]::ToBoolean("#{replaceme-gitdirty}") $sync.configs = @{} $sync.ProcessRunning = $false