Skip to content
Snippets Groups Projects
Commit 2eed2ba4 authored by Vítor Galvão's avatar Vítor Galvão Committed by GitHub
Browse files

Merge pull request #1760 from reitermarkus/version-file-separator

Disallow file separator in version strings.
parents 814a5de7 2c6516ef
No related branches found
No related tags found
No related merge requests found
...@@ -60,6 +60,7 @@ module Hbc ...@@ -60,6 +60,7 @@ module Hbc
def check_version def check_version
return unless cask.version return unless cask.version
check_no_string_version_latest check_no_string_version_latest
check_no_file_separator_in_version
end end
def check_no_string_version_latest def check_no_string_version_latest
...@@ -68,6 +69,13 @@ module Hbc ...@@ -68,6 +69,13 @@ module Hbc
add_error "you should use version :latest instead of version 'latest'" add_error "you should use version :latest instead of version 'latest'"
end end
def check_no_file_separator_in_version
odebug "Verifying version does not contain '#{File::SEPARATOR}'"
return unless cask.version.raw_version.is_a?(String)
return unless cask.version.raw_version.include?(File::SEPARATOR)
add_error "version should not contain '#{File::SEPARATOR}'"
end
def check_sha256 def check_sha256
return unless cask.sha256 return unless cask.sha256
check_sha256_no_check_if_latest check_sha256_no_check_if_latest
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment