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

Graceful error when graphing without xdg-open #394

Merged
merged 2 commits into from
Feb 16, 2024

Conversation

jfrost-mo
Copy link
Member

@jfrost-mo jfrost-mo commented Feb 15, 2024

On non-desktop systems, such as HPCs, xdg-open doesn't exist. The created file can still be viewed manually, and the new error helps users discover the -o option to set the output.

Fixes #393

The new output if xdg-open fails is thus:

❯ cset graph -r recipe.yaml 
Graph rendered to /var/tmp/054629bb-a7b6-4eb8-87e1-e653015337fa.svg
Cannot automatically display graph. Specify an output with -o instead.

To do:

  • Add tests.

On non-desktop systems, such as HPCs, xdg-open doesn't exist. The created
file can still be viewed manually, and the new error helps users discover
the -o option to set the output.

Fixes #393
@jfrost-mo jfrost-mo added bug Something isn't working portability Ensuring functionality at other sites labels Feb 15, 2024
Copy link
Contributor

github-actions bot commented Feb 15, 2024

Coverage

This makes use of mocked versions of xdg-open, but is the best we can
do without having graphical test runners.
@jfrost-mo jfrost-mo marked this pull request as ready for review February 15, 2024 11:44
Copy link
Collaborator

@JorgeBornemann JorgeBornemann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All looks good!

@jfrost-mo jfrost-mo merged commit 9368efd into main Feb 16, 2024
8 checks passed
@jfrost-mo jfrost-mo deleted the 393_graph_auto-open_fallback branch February 16, 2024 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working portability Ensuring functionality at other sites
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handle xdg-open not being available
2 participants