0

I am looking for a way to convince bash that "I've passed you a file, in the specified directory" without actually downloading and creating that directory on disk, OR pass a remote file directly to my protocol buffer compiler without writing it to disk.

I would like my protocol buffers compiler to look at a remote file, compile my classes, then finish without the .proto ever being downloaded.

I have this script which is getting us by for now

git archive --remote=git@bitbucket.org:redzoneco/asset-pipeline-protocol-buffers.git master preflight_check_service/preflight.proto | tar -x 
preflight_check_service/preflight.proto
protoc --python_out=chalicelib/protos preflight_check_service/preflight.proto
rm -r preflight_check_service

but as you can see we make the directory locally, run protoc, then remove the file. Seems like a waste.

Vincent Buscarello
  • 395
  • 2
  • 7
  • 19

1 Answers1

1

I don't think you'll be able to avoid using a temp file/directory as protoc doesn't accept it's input via stdin. There's an open ticket here, but it has received very little attention.

You could always just drop the .proto file into your destination and not worry about it. So, in your example, put it in chalicelib/protos. That'd help document what was created and why. (...for others if this is checked into source control, or just for your self if not.)

woodm1979
  • 1,151
  • 10
  • 8