From 04a049162df24cbcf824bbb596a6f39ec9a2f8e9 Mon Sep 17 00:00:00 2001 From: ImportTaste <53661808+ImportTaste@users.noreply.github.com> Date: Thu, 23 Dec 2021 14:14:21 -0600 Subject: [PATCH] Strip .git from $ModuleName --- Public/Get-GitModule.ps1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Public/Get-GitModule.ps1 b/Public/Get-GitModule.ps1 index 032042f..2e9f0c7 100644 --- a/Public/Get-GitModule.ps1 +++ b/Public/Get-GitModule.ps1 @@ -46,6 +46,8 @@ function Get-GitModule { $ModuleName = ($P1 -split '/')[-1] $tempDir = Join-Path $tmpRoot $ModuleName if (!(Test-Path $tempDir)) { + # Strip .git from variables if a directory that ends with .git isn't located (backwards compatibility) + if ($tempDir.EndsWith('.git')) { $ModuleName = $ModuleName.Substring(0,$ModuleName.Length-4) } Write-Verbose -Message "$(Get-Date -f T) creating directory $tempDir" New-Item $tempDir -ItemType Directory -Force | Out-Null } elseif (Get-ChildItem $tempDir -Force) {