generate_sample_config 534 B

123456789101112131415161718
  1. #!/bin/bash
  2. #
  3. # Update/check the docs/sample_config.yaml
  4. set -e
  5. cd `dirname $0`/..
  6. SAMPLE_CONFIG="docs/sample_config.yaml"
  7. if [ "$1" == "--check" ]; then
  8. diff -u "$SAMPLE_CONFIG" <(./scripts/generate_config --header-file docs/.sample_config_header.yaml) >/dev/null || {
  9. echo -e "\e[1m\e[31m$SAMPLE_CONFIG is not up-to-date. Regenerate it with \`scripts-dev/generate_sample_config\`.\e[0m" >&2
  10. exit 1
  11. }
  12. else
  13. ./scripts/generate_config --header-file docs/.sample_config_header.yaml -o "$SAMPLE_CONFIG"
  14. fi