summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Punt <ryan@mirum.org>2021-10-27 08:21:16 -0500
committerRyan Punt <ryan@mirum.org>2021-10-27 08:21:16 -0500
commit4a799c8e78d32268c237a3c26f0df3a403fe2b11 (patch)
tree058e38ee8f9de2949e5918cb8dab6406a7d03f29
parent6b0ab0aaa81147e4cea9ede2559ce3e5343082e9 (diff)
downloadchef-4a799c8e78d32268c237a3c26f0df3a403fe2b11.tar.gz
Swap wget for curl
Signed off by: Ryan Punt <ryan@mirum.org>
-rw-r--r--tasks/spellcheck.rb22
1 files changed, 14 insertions, 8 deletions
diff --git a/tasks/spellcheck.rb b/tasks/spellcheck.rb
index a3ffb577d7..9a4aee3e77 100644
--- a/tasks/spellcheck.rb
+++ b/tasks/spellcheck.rb
@@ -20,27 +20,33 @@ namespace :spellcheck do
sh 'cspell lint --no-progress "**/*"'
end
- task prereqs: %i{wget_check cspell_check config_check fetch_common}
+ task prereqs: %i{curl_check cspell_check config_check fetch_common}
- task :wget_check do
- wget_version = begin
- `wget --version`
+ task :curl_check do
+ curl_version = begin
+ `curl --version`
rescue
nil
end
- wget_version.is_a?(String) || abort(<<~INSTALL_WGET)
- wget is not installed
- INSTALL_WGET
+ curl_version.is_a?(String) || abort(<<~INSTALL_CURL)
+ curl is not available, cannot download chef_dictionary.txt
+ INSTALL_CURL
end
task :fetch_common do
- sh "wget -q https://raw.githubusercontent.com/chef/chef_dictionary/master/chef.txt -O chef_dictionary.txt"
+ sh "curl -s https://raw.githubusercontent.com/chef/chef_dictionary/master/chef.txt -o chef_dictionary.txt"
end
task :config_check do
require "json"
+ chef_dictionary = "chef_dictionary.txt"
+
+ unless File.readable?(chef_dictionary)
+ abort "Dictionary file '#{config_file}' not found, skipping spellcheck"
+ end
+
config_file = "cspell.json"
unless File.readable?(config_file)