pap.py: Try to locate puppy in /usr/lib/go/ if GOPATH is not set
This commit is contained in:
parent
e1bb049ef0
commit
d26b96dcc5
1 changed files with 15 additions and 10 deletions
|
@ -74,15 +74,20 @@ def main():
|
|||
msg_addr = args.dbgattach[0]
|
||||
else:
|
||||
msg_addr = None
|
||||
try:
|
||||
|
||||
binpaths = [
|
||||
# Try to get the binary from GOPATH
|
||||
gopath = os.environ["GOPATH"]
|
||||
binloc = os.path.join(gopath, "bin", "puppy")
|
||||
except:
|
||||
os.path.join(os.getenv('GOPATH', '/usr/lib/go'), 'bin'),
|
||||
# Try to get the binary from ~/.pappy/puppy
|
||||
binloc = os.path.join(data_dir, "puppy")
|
||||
if not os.path.exists(binloc):
|
||||
print("Could not find puppy binary in GOPATH or ~/.pappy. Please ensure that it has been compiled, or pass in the binary location from the command line")
|
||||
data_dir,
|
||||
]
|
||||
|
||||
for binpath in binpaths:
|
||||
binloc = os.path.join(binpath, 'puppy')
|
||||
if os.path.exists(binloc):
|
||||
break
|
||||
else:
|
||||
print('Could not find puppy binary in GOPATH or ~/.pappy. Please ensure that it has been compiled, or pass in the binary location from the command line')
|
||||
exit(1)
|
||||
config = ProxyConfig()
|
||||
if not args.lite:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue