跳到主要内容

Claude Cage · 面向 Claude 的隔离开发环境,支持桌面工作台、多账号、远程部署与移动端连接。上游 Lee-xeo/Claude-Cage 完整源码镜像,非灵栈原创;主许可 MIT,第三方组件遵循各自许可。来源:https://github.com/Lee-xeo/Claude-Cage 。手动同步,不附带 Release 安装包。

浏览文件

protoc.sh

29 行 · 970 B历史下载
1#!/bin/sh
2
3# SPDX-FileCopyrightText: Copyright The Lima Authors
4# SPDX-License-Identifier: Apache-2.0
5
6# Generate Go code from a .proto file.
7# Expected to be called from `//go:generate` directive.
8
9set -eu
10if [ "$#" -ne 1 ]; then
11 echo >&2 "Usage: $0 FILE"
12 exit 1
13fi
14
15PROTO="$1" ## a.proto
16BASE="$(basename "$PROTO" .proto)" ## a
17PB_DESC="${BASE}.pb.desc" ## a.pb.desc
18PB_GO="${BASE}.pb.go" ## a.pb.go
19GRPC_PB_GO="${BASE}_grpc.pb.go" ## a_grpc.pb.go
20
21set -x
22
23protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative "$PROTO" --descriptor_set_out="$PB_DESC"
24
25# -// - protoc v6.32.0
26# +// - protoc version [omitted for reproducibility]
27#
28# perl is used because `sed -i` is not portable across BSD (macOS) and GNU.
29perl -pi -E 's@(^//.*protoc.*)[[:blank:]]+v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+@\1 [version omitted for reproducibility]@g' "$PB_GO" "$GRPC_PB_GO"