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>
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