Skip to content

Commit

Permalink
Move capability check
Browse files Browse the repository at this point in the history
  • Loading branch information
bastian-src committed Nov 10, 2022
1 parent 5180449 commit 45c6d78
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib/proxy/archive_extract.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,9 @@ def start
end
end
end

def self.has_capability?
which(SHELL_COMMAND) ? 'extraction' : nil
end
end
end
2 changes: 1 addition & 1 deletion modules/tftp/tftp_plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Plugin < ::Proxy::Plugin
validate :verify_server_cert, boolean: true

# Expose automatic iso handling capability
capability -> { which(Proxy::ArchiveExtract::SHELL_COMMAND) ? 'extraction' : nil }
capability -> { Proxy::ArchiveExtract.has_capability? }

expose_setting :tftp_servername
end
Expand Down

0 comments on commit 45c6d78

Please sign in to comment.