mirror of https://github.com/pwndbg/pwndbg
version.py: fix build_id after recent refactors (#1393)
* version.py: fix build_id after recent refactors * fix lint
This commit is contained in:
parent
39ebd66539
commit
f01f932755
|
@ -6,8 +6,11 @@ def build_id(): # type: () -> str
|
|||
"""
|
||||
Returns pwndbg commit id if git is available.
|
||||
"""
|
||||
pwndbg_dir = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
|
||||
assert os.path.exists(os.path.join(pwndbg_dir, "gdbinit.py"))
|
||||
|
||||
try:
|
||||
git_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), ".git")
|
||||
git_path = os.path.join(pwndbg_dir, ".git")
|
||||
cmd = ["git", "--git-dir", git_path, "rev-parse", "--short", "HEAD"]
|
||||
|
||||
commit_id = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
|
||||
|
|
Loading…
Reference in New Issue