41 lines
964 B
Bash
Executable file
41 lines
964 B
Bash
Executable file
#!/usr/bin/env bash
|
|
## Script for validating exported(org->sdn) documentation files.
|
|
##
|
|
## Copyright (c) 2012-2014 Sylvain Benner
|
|
## Copyright (c) 2014-2018 Sylvain Benner & Contributors
|
|
##
|
|
## Author: Eugene Yaremenko
|
|
## URL: https://github.com/syl20bnr/spacemacs
|
|
##
|
|
## This file is not part of GNU Emacs.
|
|
##
|
|
## License: GPLv3
|
|
|
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
source "${DIR}/../shared"
|
|
|
|
if [[ -z "${CIRCLE_PR_NUMBER// }" ]]; then
|
|
echo "Skipping documentation validation for branch update."
|
|
exit 0
|
|
fi
|
|
|
|
changed_f_as_args=()
|
|
while read p
|
|
do
|
|
if [ -f "$p" ]; then
|
|
if [ ${p: -4} == ".org" ]; then
|
|
changed_f_as_args+=("${p}")
|
|
fi
|
|
fi
|
|
done </tmp/changed_files
|
|
|
|
if [ ${#changed_f_as_args[@]} -ne 0 ]; then
|
|
|
|
spacedoc validate /tmp/exported/
|
|
if [ $? -ne 0 ]; then
|
|
echo "Documentation validation failed."
|
|
exit 1
|
|
fi
|
|
else
|
|
echo "This commit doesn't change documentation files."
|
|
fi
|