revng2: allow execution in build directory

Change the logic in `python/scripts/revng` to allow executing it as
`revng2`. This allows running `revng2` in the build directory.
This commit is contained in:
Giacomo Vercesi
2026-01-21 17:00:23 +01:00
parent 93a998ce93
commit cda0a9e508
2 changed files with 7 additions and 1 deletions
+6 -1
View File
@@ -20,6 +20,11 @@ if str(new_path) not in sys.path:
sys.path.insert(0, str(new_path))
if __name__ == "__main__":
from revng.internal.cli.revng import main
name = os.path.basename(sys.argv[0])
assert name in ("revng", "revng2")
if name == "revng":
from revng.internal.cli.revng import main
else:
from revng.internal.cli.revng2 import main
sys.exit(main())