Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli/run: Require either --executable or --program #3560

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

guihkx
Copy link

@guihkx guihkx commented Nov 16, 2024

Description

This prevents a crash when bottles-cli run is invoked without an --executable or --program.

Fixes #3559

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • Without the fix:
$ flatpak run --command=bottles-cli com.usebottles.bottles run -b Default
05:35:27 (INFO) Forcing offline mode 
Traceback (most recent call last):
  File "/app/bin/bottles-cli", line 764, in <module>
    cli = CLI()
          ^^^^^
  File "/app/bin/bottles-cli", line 236, in __init__
    self.__process_args()
  File "/app/bin/bottles-cli", line 285, in __process_args
    self.run_program()
  File "/app/bin/bottles-cli", line 687, in run_program
    _executable = _executable.replace("file://", "")
                  ^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'replace'
  • With the fix:
$ flatpak run --command=bottles-cli com.usebottles.bottles run -b Default
05:41:20 (INFO) Forcing offline mode 
Please specify either --executable or --program

This prevents a crash when "bottles-cli run" is invoked without
an --executable or --program.
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.

[Bug]: bottles-cli run crashes if you don't specify either --executable or --program
1 participant