Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"version": 1,
"isRoot": true,
"tools": {
"Azure.Sdk.Tools.SnippetGenerator": {
"version": "1.0.0-dev.20241213.1",
"commands": [
"snippet-generator"
],
"rollForward": false
}
}
}
1 change: 1 addition & 0 deletions nuget.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
<!--To inherit the global NuGet package sources remove the <clear/> line below -->
<clear />
<add key="nuget" value="https://api.nuget.org/v3/index.json" />
<add key="azure-sdk-dev-feed" value="https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json" />
</packageSources>
</configuration>
24 changes: 24 additions & 0 deletions scripts/Update-Snippets.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[CmdletBinding()]
param(
[string]$Path
)

# If this is not a real path, assume snippets should be refreshed in a relative
# path to the OpenAI.csproj file from the git root.
if (-not $Path) {
$_gitRoot = git rev-parse --show-toplevel 2>$null

if ((-not $_gitRoot) -or ($LASTEXITCODE -ne 0)) {
Write-Error "Could not determine the git root directory. Please specify the path to the project file."
exit 1
}

$Path = Join-Path -Path $_gitRoot -ChildPath '/src/OpenAI.csproj'
$Path = (Resolve-Path -LiteralPath $Path).Path
}

# Update snippets
Write-Host "Updating snippets in $Path"

dotnet tool restore
dotnet tool run snippet-generator -b $Path