Skip to content

Instantly share code, notes, and snippets.

@utdemir
Last active July 16, 2018 21:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save utdemir/d39ab7bb73d999bcdcaf536f47333bfa to your computer and use it in GitHub Desktop.
Save utdemir/d39ab7bb73d999bcdcaf536f47333bfa to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
set -o errexit
set -o nounset
FULL_PATH=$(realpath "$1")
TMPDIR="$(mktemp -d)"
set -o xtrace
for i in $(unzip -t "$FULL_PATH" | grep -Po '(?<=testing: )bin[^ ]*/protoc'); do
mkdir -p $(dirname "$TMPDIR"/"$i")
cat <<EOF > "$TMPDIR"/"$i"
#!/usr/bin/env sh
set -o xtrace
protoc \$@
EOF
done
cd $TMPDIR
zip "$FULL_PATH" $(find . -name protoc)
@utdemir
Copy link
Author

utdemir commented Jul 16, 2018

Usage:

~/.coursier/cache/v1/https/repo1.maven.org/maven2/com/github/os72/protoc-jar/3.4.0/protoc-jar-3.4.0.jar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment