diff options
author | Volpeon <git@volpeon.ink> | 2020-12-26 11:02:17 +0100 |
---|---|---|
committer | Volpeon <git@volpeon.ink> | 2020-12-26 11:02:17 +0100 |
commit | a2d91f9f6812ae5ee29d00f7132e9ad983e3141b (patch) | |
tree | 05b9307421a0f2ce5b69ac40dbca8d08ab9d1d03 /scripts/build_content.sh | |
parent | Generate precompressed files, use variables for some nav-related values (diff) | |
download | volpeon.ink-a2d91f9f6812ae5ee29d00f7132e9ad983e3141b.tar.gz volpeon.ink-a2d91f9f6812ae5ee29d00f7132e9ad983e3141b.tar.bz2 volpeon.ink-a2d91f9f6812ae5ee29d00f7132e9ad983e3141b.zip |
Improved build script output
Diffstat (limited to 'scripts/build_content.sh')
-rwxr-xr-x | scripts/build_content.sh | 12 |
1 files changed, 6 insertions, 6 deletions
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 () { | |||
13 | mkdir -p $(dirname "$TARGET") | 13 | mkdir -p $(dirname "$TARGET") |
14 | 14 | ||
15 | if [ "${1#*.}" = "md" ]; then | 15 | if [ "${1#*.}" = "md" ]; then |
16 | echo "[COMPILE ] $1 -> $TARGET" | 16 | echo -e "\033[0;32m[COMPILE ]\033[0m $1 -> $TARGET" |
17 | 17 | ||
18 | pandoc "$1" \ | 18 | pandoc "$1" \ |
19 | -f markdown \ | 19 | -f markdown \ |
@@ -22,7 +22,7 @@ handle () { | |||
22 | -o "$TARGET" \ | 22 | -o "$TARGET" \ |
23 | --metadata-file metadata/metadata.json | 23 | --metadata-file metadata/metadata.json |
24 | else | 24 | else |
25 | echo "[ COPY ] $1 -> $TARGET" | 25 | echo -e "\033[0;32m[COPY ]\033[0m $1 -> $TARGET" |
26 | 26 | ||
27 | cp "$1" "$TARGET" | 27 | cp "$1" "$TARGET" |
28 | fi | 28 | fi |
@@ -45,18 +45,18 @@ elif [ "$1" = "md" ]; then | |||
45 | done | 45 | done |
46 | elif [ "$1" = "single" ]; then | 46 | elif [ "$1" = "single" ]; then |
47 | if [ -z "$2" ]; then | 47 | if [ -z "$2" ]; then |
48 | echo "[ ERROR ] \"single\" operation requires file argument" | 48 | echo -e "\033[0;31m[ERROR ]\033[0m \"single\" operation requires file argument" |
49 | else | 49 | else |
50 | handle "$2" | 50 | handle "$2" |
51 | fi | 51 | fi |
52 | elif [ "$1" = "delete" ]; then | 52 | elif [ "$1" = "delete" ]; then |
53 | if [ -z "$2" ]; then | 53 | if [ -z "$2" ]; then |
54 | echo "[ ERROR ] \"delete\" operation requires file argument" | 54 | echo -e "\033[0;31m[ERROR ]\033[0m \"delete\" operation requires file argument" |
55 | else | 55 | else |
56 | TARGET=$(target "$2") | 56 | TARGET=$(target "$2") |
57 | echo "[ DELETE ] $2 -> $TARGET" | 57 | echo -e "\033[0;32m[DELETE ]\033[0m $2 -> $TARGET" |
58 | rm -rf $TARGET | 58 | rm -rf $TARGET |
59 | fi | 59 | fi |
60 | else | 60 | else |
61 | echo "[ ERROR ] Unknown operation: \"$1\"" | 61 | echo -e "\033[0;31m[ERROR ]\033[0m Unknown operation: \"$1\"" |
62 | fi | 62 | fi |