Define archive control v1 protocol
This commit is contained in:
Executable
+40
@@ -0,0 +1,40 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
BUF_IMAGE="${BUF_IMAGE:-bufbuild/buf:1.47.2}"
|
||||
action="${1:-}"
|
||||
|
||||
case "$action" in
|
||||
format)
|
||||
shift
|
||||
set -- format -w "$@"
|
||||
;;
|
||||
lint)
|
||||
shift
|
||||
set -- lint "$@"
|
||||
;;
|
||||
build)
|
||||
shift
|
||||
set -- build -o descriptor.bin "$@"
|
||||
;;
|
||||
generate)
|
||||
shift
|
||||
set -- generate "$@"
|
||||
;;
|
||||
breaking)
|
||||
shift
|
||||
if [[ $# -ne 1 ]]; then
|
||||
echo "usage: $0 breaking <against>" >&2
|
||||
exit 2
|
||||
fi
|
||||
set -- breaking --against "$1"
|
||||
;;
|
||||
*)
|
||||
echo "usage: $0 {format|lint|build|generate|breaking <against>}" >&2
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
|
||||
exec docker run --rm --user "$(id -u):$(id -g)" \
|
||||
-e XDG_CACHE_HOME=/tmp \
|
||||
-v "$(pwd):/workspace" -w /workspace "$BUF_IMAGE" "$@"
|
||||
Reference in New Issue
Block a user