#!/usr/bin/env bash
## fix_docs Fixed(formats) Spacemacs' documentation files.
##
## Copyright (c) 2014-2021 Sylvain Benner & Contributors
## Author: Eugene Yaremenko
## URL: https://github.com/syl20bnr/spacemacs
## This file is not part of GNU Emacs.
## License: GPLv3
echo_headline "Generating new layers index file"
spacedoc layers \
-c".ci/spacedoc-cfg.edn" \
/tmp/sdn/layers
if [ $? -ne 0 ]; then
echo "Layers index generation failed."
exit 2
fi
if [ ! -f /tmp/sdn/layers/LAYERS.sdn ]; then
echo " /tmp/sdn/layers/LAYERS.sdn doesn't exist"
echo_headline "Generating new .org files from .sdn representation"
spacedoc orgify \
/tmp/sdn/ \
~/.emacs.d/
echo "Documentation generation failed."