|
1 | 1 | function New-ALGoRepo {
|
2 | 2 | Param(
|
3 |
| - $tmpFolder = (Join-Path ([System.IO.Path]::GetTempPath()) ([Guid]::NewGuid().ToString())), |
4 | 3 | [Parameter(Mandatory=$true)]
|
5 | 4 | $org,
|
6 | 5 | [Parameter(Mandatory=$true)]
|
|
12 | 11 | [Parameter(Mandatory=$true)]
|
13 | 12 | [ValidateSet('public','private')]
|
14 | 13 | $accessControl,
|
15 |
| - [Parameter(Mandatory=$true)] |
| 14 | + $algoBranch = 'main', |
| 15 | + $description = $repo, |
16 | 16 | $apps = @(),
|
17 | 17 | [HashTable] $addRepoSettings = @{},
|
18 | 18 | [HashTable] $addProjectSettings = @{},
|
|
23 | 23 | [switch] $additionalCountriesAlways,
|
24 | 24 | [switch] $openFolder,
|
25 | 25 | [switch] $openVSCode,
|
26 |
| - [switch] $openBrowser |
| 26 | + [switch] $openBrowser, |
| 27 | + $tmpFolder = (Join-Path ([System.IO.Path]::GetTempPath()) ([Guid]::NewGuid().ToString())) |
27 | 28 | )
|
28 | 29 |
|
29 | 30 | # Well known AppIds
|
|
205 | 206 | Set-Location $tmpFolder
|
206 | 207 |
|
207 | 208 | $repository = "$org/$repo"
|
208 |
| - invoke-gh repo create $repository --$accessControl --clone |
| 209 | + invoke-gh repo create $repository --$accessControl --clone --description $description |
209 | 210 | $folder = Join-Path $tmpFolder $repo
|
210 | 211 | Set-Location $folder
|
211 | 212 |
|
212 | 213 | Write-Host "Downloading and applying AL-Go-$AppType template"
|
213 |
| - $templateUrl = "https://github.com/microsoft/AL-Go-$AppType/archive/refs/heads/main.zip" |
| 214 | + $templateUrl = "https://github.com/microsoft/AL-Go-$AppType/archive/refs/heads/$($algoBranch).zip" |
214 | 215 | $tempZip = Join-Path ([System.IO.Path]::GetTempPath()) "$([Guid]::NewGuid().ToString()).zip"
|
215 | 216 | Download-File -sourceUrl $templateUrl -destinationFile $tempZip
|
216 | 217 | Expand-7zipArchive -Path $tempZip -DestinationPath $folder
|
217 | 218 | Remove-Item -Path $tempZip -Force
|
218 |
| - Copy-Item -Path "AL-Go-$appType-main\*" -Recurse -Destination . -Force |
219 |
| - Remove-Item -Path "AL-Go-$appType-main" -Recurse -Force |
| 219 | + Copy-Item -Path "AL-Go-$appType-$algoBranch\*" -Recurse -Destination . -Force |
| 220 | + Remove-Item -Path "AL-Go-$appType-$algoBranch" -Recurse -Force |
220 | 221 |
|
221 | 222 | Write-Host "Committing and pushing template"
|
222 | 223 | invoke-git -silent add *
|
|
0 commit comments