From f7ca65bf1e8937b6ba14dfc31c70416675acfbfd Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs <sbrl@starbeamrainbowlabs.com> Date: Wed, 12 Mar 2025 11:43:57 +0000 Subject: [PATCH] build: fix shellcheck errors --- build | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/build b/build index 04fcb91..e82b468 100755 --- a/build +++ b/build @@ -1,6 +1,6 @@ #!/usr/bin/env bash # Make sure the current directory is the location of this script to simplify matters -cd "$(dirname $(readlink -f $0))"; +cd "$(dirname "$(readlink -f "${0}")")"; ################ ### Settings ### ################ @@ -23,11 +23,13 @@ lantern_path="./lantern-build-engine"; # Check out the lantern git submodule if needed if [ ! -f "${lantern_path}/lantern.sh" ]; then git submodule update --init "${lantern_path}"; fi +#shellcheck disable=SC1091 source "${lantern_path}/lantern.sh"; if [[ "$#" -lt 1 ]]; then echo -e "${FBLE}${project_name}${RS} build script"; echo -e " by Starbeamrainbowlabs"; + #shellcheck disable=SC2154 echo -e "${LC}Powered by the lantern build engine, v${version}${RS}"; echo -e ""; echo -e "${CSECTION}Usage${RS}"; @@ -35,7 +37,7 @@ if [[ "$#" -lt 1 ]]; then echo -e ""; echo -e "${CSECTION}Available actions${RS}"; echo -e " ${CACTION}setup${RS} - Perform initial setup"; - echo -e " ${CACTION}render${RS} - Render the LaTeX exmaples"; + echo -e " ${CACTION}render${RS} - Render the LaTeX examples"; echo -e ""; exit 1; @@ -77,14 +79,14 @@ _render-latex-pdf() { task_end $? "Failed to enter directory (does it exist?)"; task_begin "Cleaning up"; - find -iname "*.aux" -delete; # Ref: https://tex.stackexchange.com/q/381057 - find -iname "*.bbl" -delete; - find -iname "*.blg" -delete; - find -iname "*.out" -delete; + find . -iname "*.aux" -delete; # Ref: https://tex.stackexchange.com/q/381057 + find . -iname "*.bbl" -delete; + find . -iname "*.blg" -delete; + find . -iname "*.out" -delete; task_end $? "Error: Failed to clean up after last build"; # task_begin "Rendering images"; - # # FUTURE: Do this in paralell? + # # FUTURE: Do this in parallel? # for svg_filename in $(find "images/" -type f -iname "*.svg"); do # execute inkscape -e ${svg_filename%%.svg}.png ${svg_filename}; # exit_code=$?; @@ -105,7 +107,7 @@ _render-latex-pdf() { task_end $? "Error: Failed to build report"; task_begin "Moving report"; - execute mv *.pdf ..; + execute mv ./*.pdf ..; task_end $? "Failed to move report"; cd -; @@ -114,4 +116,4 @@ _render-latex-pdf() { ############################################################################### -tasks_run $@; +tasks_run "$@";