Skip to content

Commit

Permalink
Update src/ALZ/Private/Test-ALZGitRepository.ps1
Browse files Browse the repository at this point in the history
Co-authored-by: Jared Holgate <[email protected]>
  • Loading branch information
oZakari and jaredfholgate authored Jan 12, 2024
1 parent bb39462 commit d7ffc81
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/ALZ/Private/Test-ALZGitRepository.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,12 @@ function Test-ALZGitRepository {
}
$gitInit = Read-Host "Initialize the directory $alzEnvironmentDestination as a git repository? (y/n)"
if ($gitInit -ieq "y" -and $PSCmdlet.ShouldProcess("gitrepository", "initialize")) {
if ((git config --get init.defaultbranch) -eq "master") {
git init -b main $alzEnvironmentDestination
return $true
} else {
git init $alzEnvironmentDestination
return $true
$gitBranch = Read-Host "Enter the default branch name. (Hit enter to skip and use 'main')"
if($gitBranch -eq "") {
$gitBranch = "main"
}
git init -b $gitBranch $alzEnvironmentDestination
return $true
}
return $false
}

0 comments on commit d7ffc81

Please sign in to comment.