From cb76629c2057c25652103b889888da9337227eca Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Tue, 28 Mar 2023 08:43:16 +0200 Subject: [PATCH] Update clean-repo.ps1 and pull-repo.ps1 --- Scripts/clean-repo.ps1 | 12 ++++++------ Scripts/pull-repo.ps1 | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Scripts/clean-repo.ps1 b/Scripts/clean-repo.ps1 index a464b08c..5f8afd24 100755 --- a/Scripts/clean-repo.ps1 +++ b/Scripts/clean-repo.ps1 @@ -1,11 +1,11 @@ <# .SYNOPSIS - Clean a repository + Cleans a repo .DESCRIPTION - This PowerShell script deletes all untracked files and folders in a Git repository (including submodules). + This PowerShell script deletes all untracked files and folders in a local Git repository (including submodules). NOTE: To be used with care! This cannot be undone! .PARAMETER RepoDir - Specifies the path to the Git repository + Specifies the file path to the local Git repository .EXAMPLE PS> ./clean-repo C:\MyRepo .LINK @@ -27,7 +27,7 @@ try { "⏳ (2/4) Checking Git repository... 📂$RepoDirName" if (-not(Test-Path "$RepoDir" -pathType container)) { throw "Can't access folder '$RepoDir' - maybe a typo or missing folder permissions?" } - "⏳ (3/4) Removing untracked files in repository..." + "⏳ (3/4) Removing untracked files in the repository..." & git -C "$RepoDir" clean -xfd -f # to delete all untracked files in the main repo if ($lastExitCode -ne "0") { Write-Warning "'git clean' failed with exit code $lastExitCode, retrying once..." @@ -35,12 +35,12 @@ try { if ($lastExitCode -ne "0") { throw "'git clean' failed with exit code $lastExitCode" } } - "⏳ (4/4) Removing untracked files in submodules..." + "⏳ (4/4) Removing untracked files in the submodules..." & git -C "$RepoDir" submodule foreach --recursive git clean -xfd -f # to delete all untracked files in the submodules if ($lastExitCode -ne "0") { throw "'git clean' in the submodules failed with exit code $lastExitCode" } [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds - "✔️ cleaned 📂$RepoDirName repository in $Elapsed sec." + "✔️ cleaned 📂$RepoDirName repo in $Elapsed sec" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" diff --git a/Scripts/pull-repo.ps1 b/Scripts/pull-repo.ps1 index e6eaa607..badddbb1 100755 --- a/Scripts/pull-repo.ps1 +++ b/Scripts/pull-repo.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - Pulls Git repo updates + Pulls updates into a repo .DESCRIPTION - This PowerShell script pulls updates into a local Git repository (including submodules). + This PowerShell script pulls the latest updates into a local Git repository (including submodules). .PARAMETER RepoDir Specifies the file path to the local Git repository (default is working directory) .EXAMPLE @@ -38,7 +38,7 @@ try { if ($lastExitCode -ne "0") { throw "'git submodule update' failed with exit code $lastExitCode" } [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds - "✔️ updated 📂$RepoDirName repository in $Elapsed sec." + "✔️ updated 📂$RepoDirName repo in $Elapsed sec" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"