29 lines
782 B
PowerShell
29 lines
782 B
PowerShell
|
New-Item -Path "api" -Name "gRPC" -ItemType Directory -Force
|
||
|
|
||
|
$plugName = ""
|
||
|
|
||
|
protoc `
|
||
|
--proto_path=third_party/grpc-proto `
|
||
|
--go_out=api/gRPC `
|
||
|
--go_opt=paths=source_relative `
|
||
|
--go-grpc_out=api/gRPC `
|
||
|
--go-grpc_opt=paths=source_relative `
|
||
|
third_party/grpc-proto/*.proto `
|
||
|
|
||
|
|
||
|
function Replace-Text {
|
||
|
param (
|
||
|
[string]$Path,
|
||
|
[string]$OldText,
|
||
|
[string]$NewText
|
||
|
)
|
||
|
|
||
|
Get-ChildItem -Path $Path -Recurse -File | ForEach-Object {
|
||
|
$content = Get-Content $_.FullName
|
||
|
$content = $content -replace $OldText, $NewText
|
||
|
Set-Content -Path $_.FullName -Value $content
|
||
|
}
|
||
|
}
|
||
|
|
||
|
Replace-Text -Path "./api/gRPC" -OldText "git.dragse.it/anthrove/plug-[REPLACE_ME]/api/gRPC" -NewText "git.dragse.it/anthrove/plug-$plugName/api/gRPC"
|