Skip to content

Commit

Permalink
setup.py: fix for issue #96
Browse files Browse the repository at this point in the history
  • Loading branch information
NoMore201 committed Nov 25, 2019
1 parent a686f55 commit ac404b3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,22 @@

import os.path
import subprocess
import shutil

PROTOC_BIN = "/usr/bin/protoc"
PROTOC_EXEC = "protoc"

CURRENT_DIR = os.path.abspath( os.path.dirname( __file__ ) )

class ProtobufBuilder(_build):

def run(self):
# check if protobuf is installed
if not os.path.isfile(PROTOC_BIN):
exec_path = shutil.which(PROTOC_EXEC)
if exec_path is None:
raise Exception("You should install protobuf compiler")

print("Building protobuf file")
subprocess.run([PROTOC_BIN,
subprocess.run([exec_path,
"--proto_path=" + CURRENT_DIR,
"--python_out=" + CURRENT_DIR + "/gpapi/",
CURRENT_DIR + "/googleplay.proto"])
Expand Down

0 comments on commit ac404b3

Please # to comment.