Skip to content

Commit

Permalink
Error if import directory doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdoupe committed Oct 21, 2024
1 parent 664525a commit 11e4f23
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pwnshop/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,11 @@ def main():
pwn.context.log_level = "ERROR"

if getattr(args, "import", None):
imports = glob.glob(getattr(args, "import"))
import_dir = getattr(args, "import")
if not os.path.isdir(import_dir):
print(f"Error, {import_dir=} does not exist")
return -1
imports = glob.glob(import_dir)
for i in imports:
i = i.rstrip("/")
sys.path.append(os.path.realpath(os.path.dirname(i)))
Expand Down

0 comments on commit 11e4f23

Please sign in to comment.