Skip to content
This repository has been archived by the owner on Dec 11, 2024. It is now read-only.

Commit

Permalink
Add option to disable hexeditor support.
Browse files Browse the repository at this point in the history
The GHex package on Ubuntu doesn't ship the Gir files, so I can't
build it on CI.
  • Loading branch information
hugopl committed Jul 12, 2024
1 parent 7c146e1 commit a7b4028
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ jobs:
- name: Run tests
uses: GabrielBB/xvfb-action@v1
with:
run: crystal spec ${{ matrix.flags }} -v
run: crystal spec ${{ matrix.flags }} -v -Dno_hexeditor
2 changes: 2 additions & 0 deletions src/hex_view.cr
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{% skip_file if flag?(:no_hexeditor) %}

GICrystal.require("Hex", "4")

Check failure on line 3 in src/hex_view.cr

View workflow job for this annotation

GitHub Actions / tests (-Dno_terminal)

Bindings for Hex-4 not yet generated, run ./bin/gi-crystal first.

class HexView < DocumentView
Expand Down
6 changes: 5 additions & 1 deletion src/view_factory.cr
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ class ViewFactory
if image?(resource)
raise TijoloError.new("Image files are not supported yet 😅.")
elsif elf?(resource)
HexView.new(resource, project)
{% if flag?(:no_hexeditor) %}
raise TijoloError.new("Tijolo was compiled without support for an hexeditor 😢.")
{% else %}
HexView.new(resource, project)
{% end %}
else
TextView.new(resource, project)
end
Expand Down

0 comments on commit a7b4028

Please sign in to comment.