openai/openai-dotnet

Public

mirrored from https://github.com/openai/openai-dotnetAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
joseharriaga/ReorganizeExamples

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

scripts/Update-Snippets.ps1

24lines · modecode

1[CmdletBinding()]
2param(
3 [string]$Path
4)
5
6# If this is not a real path, assume snippets should be refreshed in a relative
7# path to the OpenAI.csproj file from the git root.
8if (-not $Path) {
9 $_gitRoot = git rev-parse --show-toplevel 2>$null
10
11 if ((-not $_gitRoot) -or ($LASTEXITCODE -ne 0)) {
12 Write-Error "Could not determine the git root directory. Please specify the path to the project file."
13 exit 1
14 }
15
16 $Path = Join-Path -Path $_gitRoot -ChildPath '/src/OpenAI.csproj'
17 $Path = (Resolve-Path -LiteralPath $Path).Path
18}
19
20# Update snippets
21Write-Host "Updating snippets in $Path"
22
23dotnet tool restore
24dotnet tool run snippet-generator -b $Path