Skip to content

Conversation

@ericwb
Copy link
Contributor

@ericwb ericwb commented Nov 1, 2024

This change fixes --gist argument which was raising a traceback. Also adds a unit test of the condition where --gist is specified but GITHUB_TOKEN is undefined.

Traceback (most recent call last):
  File "/Users/ericwb/workspace/precli/.tox/py313/bin/precli", line 8, in <module>
    sys.exit(main())
             ~~~~^^
  File "/Users/ericwb/workspace/precli/precli/cli/main.py", line 306, in main
    create_gist(file, renderer)
    ~~~~~~~~~~~^^^^^^^^^^^^^^^^
  File "/Users/ericwb/workspace/precli/precli/cli/main.py", line 238, in create_gist
    "files": {filename: {"content": file_content}},
              ^^^^^^^^
UnboundLocalError: cannot access local variable 'filename' where it is not associated with a value

This change fixes --gist argument which was raising a
traceback. Also adds a unit test of the condition where
--gist is specified but GITHUB_TOKEN is undefined.

Signed-off-by: Eric Brown <eric.brown@securesauce.dev>
@ericwb ericwb merged commit aebc25f into securesauce:main Nov 1, 2024
@ericwb ericwb deleted the broken_gist branch November 1, 2024 02:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant