From a2d91f9f6812ae5ee29d00f7132e9ad983e3141b Mon Sep 17 00:00:00 2001 From: Volpeon Date: Sat, 26 Dec 2020 11:02:17 +0100 Subject: Improved build script output --- Makefile | 5 +++-- scripts/build_content.sh | 12 ++++++------ scripts/build_fonts.sh | 4 ++-- scripts/build_sass.sh | 2 +- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index caf9939..b8ebbbe 100644 --- a/Makefile +++ b/Makefile @@ -16,11 +16,11 @@ build_content: clean build_only: build_fonts build_sass build_content compress_gz: build_only - @echo "[COMPRESS] Gzip" + @echo -e "\033[0;32m[COMPRESS]\033[0m Gzip" @pigz -R -k -9 -- `find output -type f -iregex '.*\\.\\(css\\|js\\|json\\|html\\|xml\\|txt\\|svg\\|ico\\)'` compress_br: build_only - @echo "[COMPRESS] Brotli" + @echo -e "\033[0;32m[COMPRESS]\033[0m Brotli" @brotli -k -- `find output -type f -iregex '.*\\.\\(css\\|js\\|json\\|html\\|xml\\|txt\\|svg\\|ico\\|woff\\)'` build: compress_gz compress_br @@ -45,6 +45,7 @@ serve_only: build_only serve: watch serve_only deploy: build + @echo -e "\033[0;32m[DEPLOY ]\033[0m volpeon.ink" @rsync --progress --stats -avz --delete output/ vulpes@94.130.78.123:/srv/http/volpeon.ink/ .PHONY: all clean build watch serve deploy diff --git a/scripts/build_content.sh b/scripts/build_content.sh index 9623427..8acdcdf 100755 --- a/scripts/build_content.sh +++ b/scripts/build_content.sh @@ -13,7 +13,7 @@ handle () { mkdir -p $(dirname "$TARGET") if [ "${1#*.}" = "md" ]; then - echo "[COMPILE ] $1 -> $TARGET" + echo -e "\033[0;32m[COMPILE ]\033[0m $1 -> $TARGET" pandoc "$1" \ -f markdown \ @@ -22,7 +22,7 @@ handle () { -o "$TARGET" \ --metadata-file metadata/metadata.json else - echo "[ COPY ] $1 -> $TARGET" + echo -e "\033[0;32m[COPY ]\033[0m $1 -> $TARGET" cp "$1" "$TARGET" fi @@ -45,18 +45,18 @@ elif [ "$1" = "md" ]; then done elif [ "$1" = "single" ]; then if [ -z "$2" ]; then - echo "[ ERROR ] \"single\" operation requires file argument" + echo -e "\033[0;31m[ERROR ]\033[0m \"single\" operation requires file argument" else handle "$2" fi elif [ "$1" = "delete" ]; then if [ -z "$2" ]; then - echo "[ ERROR ] \"delete\" operation requires file argument" + echo -e "\033[0;31m[ERROR ]\033[0m \"delete\" operation requires file argument" else TARGET=$(target "$2") - echo "[ DELETE ] $2 -> $TARGET" + echo -e "\033[0;32m[DELETE ]\033[0m $2 -> $TARGET" rm -rf $TARGET fi else - echo "[ ERROR ] Unknown operation: \"$1\"" + echo -e "\033[0;31m[ERROR ]\033[0m Unknown operation: \"$1\"" fi diff --git a/scripts/build_fonts.sh b/scripts/build_fonts.sh index d8ed9ea..bd168df 100755 --- a/scripts/build_fonts.sh +++ b/scripts/build_fonts.sh @@ -1,6 +1,6 @@ #!/bin/bash -echo "[ MINIFY ] assets/fonts/iosevka-term-ss09-regular.ttf -> output/iosevka-term-ss09-regular.woff2" +echo -e "\033[0;32m[MINIFY ]\033[0m assets/fonts/iosevka-term-ss09-regular.ttf -> output/iosevka-term-ss09-regular.woff2" pyftsubset assets/fonts/iosevka-term-ss09-regular.ttf \ --text-file='assets/fonts/glyphs.txt' \ @@ -8,7 +8,7 @@ pyftsubset assets/fonts/iosevka-term-ss09-regular.ttf \ --flavor='woff2' \ --output-file='output/iosevka-term-ss09-regular.woff2' -echo "[ MINIFY ] assets/fonts/iosevka-term-ss09-bold.ttf -> output/iosevka-term-ss09-bold.woff2" +echo -e "\033[0;32m[MINIFY ]\033[0m assets/fonts/iosevka-term-ss09-bold.ttf -> output/iosevka-term-ss09-bold.woff2" pyftsubset assets/fonts/iosevka-term-ss09-bold.ttf \ --text-file='assets/fonts/glyphs.txt' \ diff --git a/scripts/build_sass.sh b/scripts/build_sass.sh index 2711a89..df1c0a9 100755 --- a/scripts/build_sass.sh +++ b/scripts/build_sass.sh @@ -1,4 +1,4 @@ #!/bin/bash -echo "[COMPILE ] assets/css/style.scss -> output/style.css" +echo -e "\033[0;32m[COMPILE ]\033[0m assets/css/style.scss -> output/style.css" sassc assets/css/style.scss | node_modules/.bin/csso > output/style.css -- cgit v1.2.3-70-g09d2