21494: Run linkchecker task unconditionally
authorBrett Smith <brett.smith@curii.com>
Thu, 22 Feb 2024 19:25:05 +0000 (14:25 -0500)
committerBrett Smith <brett.smith@curii.com>
Thu, 22 Feb 2024 19:25:05 +0000 (14:25 -0500)
This better matches the new behavior of SDK doc build tasks. It also
just makes sense IMO: linkchecker never runs implicitly, only when you
request it, so if it can't do what you asked I think that should count
as failure.

Arvados-DCO-1.1-Signed-off-by: Brett Smith <brett.smith@curii.com>

doc/Rakefile

index 6b1b0d2ac3c0aaef1f77d831020d3e7bf58df4dd..c4e26cfb3b47eb78d2600057c1bab157a8858a6e 100644 (file)
@@ -195,15 +195,16 @@ file "sdk/java-v2/javadoc/index.html" do |t|
 end
 
 task :linkchecker => [ :generate ] do
-  if !can_run?("linkchecker", "--version")
-    puts "Warning: linkchecker not found, skipping run".colorize(:light_red)
-    next
-  end
   # we need --check-extern to check relative links, weird but true
-  system(
+  result = system(
     "linkchecker", "index.html", "--check-extern", "--ignore-url=!file://",
     chdir: ".site",
-  ) or exit $?.exitstatus
+  )
+  if result.nil?
+    fail "could not run linkchecker command (is it installed?)"
+  elsif !result
+    fail "linkchecker exited #{$?.exitstatus}"
+  end
 end
 
 task :import_vscode_training do