From 9a2959c5355fb6c5cbfbdffd7ae0d60193a40729 Mon Sep 17 00:00:00 2001 From: timurgordon Date: Tue, 14 Nov 2023 10:36:24 +0300 Subject: [PATCH] build script works from anywhere --- build.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 3e11e8e..c118f48 100755 --- a/build.sh +++ b/build.sh @@ -1,5 +1,9 @@ echo "Starting build..." +SOURCE=${BASH_SOURCE[0]} +DIR_OF_THIS_SCRIPT="$( dirname "$SOURCE" )" +ABS_DIR_OF_SCRIPT="$( realpath $DIR_OF_THIS_SCRIPT )" + # TODO: Check if current version is latest to avoid redundant installation if [[ -f "tailwindcss" ]] then @@ -39,6 +43,6 @@ fi echo "Compiling tailwindcss and building zola project..." rm -rf public static/css ./tailwindcss -i css/index.css -o ./static/css/index.css --minify -zola build +zola --root $ABS_DIR_OF_SCRIPT build