From 3e5308bf1416aa6374e6182ea08bbda1c26f7ef0 Mon Sep 17 00:00:00 2001 From: Matthias Portzel Date: Sat, 16 Sep 2023 21:33:20 -0400 Subject: [PATCH] Update rebuild.sh to not be position dependent --- paper-houses-theme/rebuild.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/paper-houses-theme/rebuild.sh b/paper-houses-theme/rebuild.sh index 6f57cef..5bc517e 100755 --- a/paper-houses-theme/rebuild.sh +++ b/paper-houses-theme/rebuild.sh @@ -2,10 +2,15 @@ # Should be run as ./rebuild.sh -if ! command -v sass &> /dev/null -then - echo "sass could not be found. Please install sass" - exit -fi +( + # CD to the directory that this file is in + cd $(dirname "$0") -sass -w assets/styles/main.scss assets/built/main.css + if ! command -v sass &> /dev/null + then + echo "sass could not be found. Please install sass" + exit + fi + + sass -w assets/styles/main.scss assets/built/main.css +)