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]
|
msg_addr = args.dbgattach[0]
|
||||||
else:
|
else:
|
||||||
msg_addr = None
|
msg_addr = None
|
||||||
try:
|
|
||||||
|
binpaths = [
|
||||||
# Try to get the binary from GOPATH
|
# Try to get the binary from GOPATH
|
||||||
gopath = os.environ["GOPATH"]
|
os.path.join(os.getenv('GOPATH', '/usr/lib/go'), 'bin'),
|
||||||
binloc = os.path.join(gopath, "bin", "puppy")
|
|
||||||
except:
|
|
||||||
# Try to get the binary from ~/.pappy/puppy
|
# Try to get the binary from ~/.pappy/puppy
|
||||||
binloc = os.path.join(data_dir, "puppy")
|
data_dir,
|
||||||
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")
|
|
||||||
|
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)
|
exit(1)
|
||||||
config = ProxyConfig()
|
config = ProxyConfig()
|
||||||
if not args.lite:
|
if not args.lite:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue