securesauce / precli

Precaution CLI
https://precli.readthedocs.io/
Other
7 stars 2 forks source link

Traceback when targeting a file that doesn't exist #497

Open ericwb opened 1 month ago

ericwb commented 1 month ago

Describe the bug Traceback when targeting a file that doesn't exist.

To Reproduce Steps to reproduce the behavior:

  1. Run .tox/py312/bin/precli ../setup.py (Note: ../setup.py file doesn't exist)
  2. See error
Erics-MacBook-Pro-2:precli ericwb$ .tox/py312/bin/precli ../setup.py
Traceback (most recent call last):
  File "/Users/ericwb/workspace/precli/.tox/py312/bin/precli", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Users/ericwb/workspace/precli/precli/cli/main.py", line 351, in main
    run.invoke()
  File "/Users/ericwb/workspace/precli/precli/core/run.py", line 187, in invoke
    with open(artifact.file_name, "rb") as f:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '../setup.py'

Expected behavior No tracebacks

Version

precli 0.5.5.dev28
Copyright 2024 Secure Sauce LLC
License BUSL-1.1: Business Source License 1.1 <https://spdx.org/licenses/BUSL-1.1.html>
  Python 3.12.2 (main, May 13 2024, 16:18:42) [Clang 15.0.0 (clang-1500.3.9.4)]

Additional context Add any other context about the problem here.