Skip to content

Commit

Permalink
Strip .git from $ModuleName
Browse files Browse the repository at this point in the history
  • Loading branch information
God-damnit-all committed Nov 22, 2022
1 parent 5f7760e commit c54d095
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Public/Get-GitModule.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -112,4 +114,4 @@ function Get-GitModule {
Write-Verbose -Message "$(Get-Date -f G) $FunctionName completed"
}

}
}

0 comments on commit c54d095

Please sign in to comment.