Skip to content
Snippets Groups Projects
Select Git revision
  • 183d6d3a25350e4dba7a306444d51da10e50a7cb
  • master default
  • rtde
  • tmp-gpg-key-workaround-2
  • tmp-gpg-key-workaround
  • 68-git-lfs-error-in-ddeploy-job
  • split-build-and-test
  • 66-jazzy-support
  • 62-deploy-jobs-do-not-pull-files-from-lfs-manual-lfs-pull
  • 62-deploy-jobs-do-not-pull-files-from-lfs-custom-docker-image
  • py3-without-industrial-ci-test
  • 58-add-yolo-pip-package-support
  • 55-collision-between-test-jobs-due-to-dds-autodiscovery-ros2
  • 52-ddeploy-job-failing-when-enforcing-labels-alt-quick-dind-test
  • 48-python3_syntax
  • 46-default-docker-image-name-too-long
  • 45-double-pipeline-triggered-if-merge-request-has-melodic-branch-name
  • 40-repo-is-ros-testing
  • test-badges
  • test-lfs-concept
  • add-packages
21 results

asciidoctor_syntax_check.bash

Blame
  • asciidoctor_syntax_check.bash 668 B
    #!/bin/bash
    
    if ! [ -x "$(command -v asciidoctor)" ]; then
        echo "Error: asciidoctor is not installed"
        exit 1
    fi
    
    if [ -z "$1" ] ; then
        echo "Error: No argument supplied - path needed"
        exit 1
    fi
    
    touch output.log # avoid failing if no adoc files exist
    while IFS= read -r -d '' filename; do
      asciidoctor "$filename" 2>&1 | tee -a output.log
    done < <(find "$1" -name '*.adoc' -type f -print0)
    adoc_errors=0 ; adoc_warnings=0
    adoc_errors=$(grep -c "ERROR" output.log)
    adoc_warnings=$(grep -c "WARNING" output.log)
    echo "AsciiDoc format Found ${adoc_errors} errors and ${adoc_warnings} warnings"
    if [ "${adoc_errors}" -eq 0 ]; then exit 0; else exit 1; fi