Skip to content

Commit

Permalink
WiP: board-docs: very initial hook board_docs, after image build
Browse files Browse the repository at this point in the history
  • Loading branch information
rpardini committed May 8, 2023
1 parent 09f6790 commit 7b6339d
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
24 changes: 24 additions & 0 deletions lib/functions/docs/board-docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#
# SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2023 Ricardo Pardini <ricardo@pardini.net>
# This file is a part of the Armbian Build Framework https://github.com/armbian/build/
#

function prepare_board_docs_via_exts() {
# Run the hooks, which writes to stdout, in a subshell, and capture stdout into a variable.
declare board_docs=""
board_docs="$(
call_extension_method "board_docs" <<- 'BOARD_DOCS'
*write documentation about the board/branch combination*
you should write Markdown to stdout. it runs late in the build process. output will be processed and rendered into ANSI/HTML.
BOARD_DOCS
)"

if [[ "${board_docs}" != "" ]]; then
display_alert "Board documentation" "${board_docs}" "info"
fi
}

function post_build_image__board_docs() {
prepare_board_docs_via_exts || true # don't fail
}
9 changes: 9 additions & 0 deletions lib/library-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,15 @@ set -o errexit ## set -e : exit the script if any statement returns a non-true
# shellcheck source=lib/functions/configuration/package-lists.sh
source "${SRC}"/lib/functions/configuration/package-lists.sh

# no errors tolerated. invoked before each sourced file to make sure.
#set -o pipefail # trace ERR through pipes - will be enabled "soon"
#set -o nounset ## set -u : exit the script if you try to use an uninitialised variable - one day will be enabled
set -o errtrace # trace ERR through - enabled
set -o errexit ## set -e : exit the script if any statement returns a non-true return value - enabled
### lib/functions/docs/board-docs.sh
# shellcheck source=lib/functions/docs/board-docs.sh
source "${SRC}"/lib/functions/docs/board-docs.sh

# no errors tolerated. invoked before each sourced file to make sure.
#set -o pipefail # trace ERR through pipes - will be enabled "soon"
#set -o nounset ## set -u : exit the script if you try to use an uninitialised variable - one day will be enabled
Expand Down

0 comments on commit 7b6339d

Please sign in to comment.