From 425a6c35341bdec1f4626469fd59685756a26a6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Phan=20B=C3=ACnh=20Nguy=C3=AAn=20L=C3=A2m?= <76941117+LLaammTTeerr@users.noreply.github.com> Date: Fri, 27 Sep 2024 20:34:01 +0700 Subject: [PATCH] update make_style.sh --- make_style.sh | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/make_style.sh b/make_style.sh index 22a2b9f27..0a293ce7f 100755 --- a/make_style.sh +++ b/make_style.sh @@ -1,14 +1,27 @@ #!/bin/sh -cd "$(dirname "$0")" || exit +if ! [ -x "$(command -v sass)" ]; then + echo 'Error: sass is not installed.' >&2 + exit 1 +fi + +if ! [ -x "$(command -v postcss)" ]; then + echo 'Error: postcss is not installed.' >&2 + exit 1 +fi -node scripts/check-package-installed.js postcss sass autoprefixer || exit +if ! [ -x "$(command -v autoprefixer)" ]; then + echo 'Error: autoprefixer is not installed.' >&2 + exit 1 +fi + +cd "$(dirname "$0")" || exit build_style() { echo "Creating $1 style..." cp resources/vars-$1.scss resources/vars.scss - npx sass resources:sass_processed - npx postcss sass_processed/style.css sass_processed/martor-description.css sass_processed/select2-dmoj.css --verbose --use autoprefixer -d $2 + sass resources:sass_processed + postcss sass_processed/style.css sass_processed/martor-description.css sass_processed/select2-dmoj.css --verbose --use autoprefixer -d $2 } build_style 'default' 'resources' -build_style 'dark' 'resources/dark' +build_style 'dark' 'resources/dark' \ No newline at end of file