-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Closed
Labels
Description
There's some weird interactions going on, and some things I might like to see changed:
install_protoc.shchecks the protoc version in your path before downloading, and refuses to download if your path's protoc is a different version than you'd like to install- A function called
download_binaryshouldn't do other checks; those checks should be moved elsewhere. - This line makes no sense:
grpc-go/scripts/install_protoc.sh
Line 63 in 45d44a7
INSTALL_PATH=${1:+"$1"} - This line needs quotes:
Line 54 in 45d44a7
source ./scripts/install_protoc.sh $WORKDIR - This line probably needs
exportin case aGOBINisn't already exported:(Line 27 in 45d44a7
GOBIN="${WORKDIR}"/bin go installneeds to be able to read it.) regenerate.shcallsinstall_protoc.shafter several other things have been done.regenerate.shapparently tries to "save your$PATH", but since it shouldn't be executed viasourcethere's no need to do any of this.- Super nit-picky:
install_protoc.shsourcesvet_common.shbut is not avet*script. Maybe renamevet_common.shtocommon.sh?
IMO one of three models for these scripts seems pretty reasonable:
- Always download everything into a temp directory.
- Downside: needs to download/recompile every time regenerate is run
- Check the versions in your path and print help/commands to update them to the needed versions.
- Downside: it's hard to know where the user would want protoc to live.
- Carve out a directory like
$HOME/grpc-go-toolsor$HOME/tmp/grpc-go-toolsor something and download the tools there if the versions don't match.
- Downside: you're potentially polluting the user's directory.
Of these, I think I prefer (2) but am not strongly opposed to any of them. It looks like the scripts were already trying to implement (1), which is okay but is my least favorite option.