File indexing completed on 2024-04-28 05:27:06

0001 #!/bin/sh
0002 
0003 # SPDX-FileCopyrightText: 2019 Mikhail Zolotukhin <zomial@protonmail.com>
0004 #
0005 # SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0006 
0007 # Usage: build_sass <source-directory> <target-directory> <include-directory>
0008 build_sass() {
0009   if command -v sassc >/dev/null 2>&1; then
0010       sassc -I "$3" "$1" "$2"
0011   else
0012       sass -I "$3" --cache-location /tmp/sass-cache "$1" "$2"
0013   fi
0014 }
0015 
0016 # Usage: build_and_install_decorations_css <target-directory>
0017 build_and_install_decorations_css() {
0018   BUILD_DIR="$(mktemp -d)"
0019   INSTALL_DIR="$1"
0020 
0021   # Build
0022   build_sass "window_decorations.scss" "${BUILD_DIR}/window_decorations.css"
0023 
0024   # Install
0025   mkdir -p "${INSTALL_DIR}"
0026   mv -f "${BUILD_DIR}/window_decorations.css" "${INSTALL_DIR}"
0027 }
0028 
0029 build_and_install_decorations_css "$1"