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

Commit

Permalink
Fix compilation with -Dno_hexeditor.
Browse files Browse the repository at this point in the history
  • Loading branch information
hugopl committed Jul 16, 2024
1 parent 8abd870 commit 114c1f6
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/view_factory.cr
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@ class ViewFactory

def self.build(resource : Path, project : Project) : View
if image?(resource)
HexView.new(resource, project).tap do |view|
view.add_toast("Image files are not supported yet. Have fun with an hex editor 😅")
end
{% if flag?(:no_hexeditor) %}
raise TijoloError.new("Image files not yet supported.")
{% else %}
HexView.new(resource, project).tap do |view|
view.add_toast("Image files are not supported yet. Have fun with an hex editor 😅")
end
{% end %}
elsif binary?(resource)
{% if flag?(:no_hexeditor) %}
raise TijoloError.new("Tijolo was compiled without support for an hexeditor 😢.")
Expand Down

0 comments on commit 114c1f6

Please sign in to comment.