summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolpeon <git@volpeon.ink>2020-12-22 12:15:41 +0100
committerVolpeon <git@volpeon.ink>2020-12-22 12:15:41 +0100
commit06ec7c2f0e2c30dd41978461bbe6d64103cb9bed (patch)
tree27bc8bf9f3bb110e2aef642b8d35bc10096ceda5
parentMisc changes (diff)
downloadvolpeon.ink-06ec7c2f0e2c30dd41978461bbe6d64103cb9bed.tar.gz
volpeon.ink-06ec7c2f0e2c30dd41978461bbe6d64103cb9bed.tar.bz2
volpeon.ink-06ec7c2f0e2c30dd41978461bbe6d64103cb9bed.zip
Fixed problems with the build scripts
-rwxr-xr-xscripts/build_content.sh8
-rwxr-xr-xscripts/watch_content.sh12
-rwxr-xr-xscripts/watch_sass.sh4
3 files changed, 14 insertions, 10 deletions
diff --git a/scripts/build_content.sh b/scripts/build_content.sh
index 992414d..e15293e 100755
--- a/scripts/build_content.sh
+++ b/scripts/build_content.sh
@@ -3,7 +3,11 @@
3SITE_TITLE="Volpeon's Den" 3SITE_TITLE="Volpeon's Den"
4 4
5target () { 5target () {
6 echo "dist/$(echo ${1%.md}.html | cut -sd / -f 2-)" 6 if [ "${1#*.}" = "md" ]; then
7 echo "dist/$(echo "${1%.md}.html" | cut -sd / -f 2-)"
8 else
9 echo "dist/$(echo "$1" | cut -sd / -f 2-)"
10 fi
7} 11}
8 12
9compile () { 13compile () {
@@ -26,7 +30,7 @@ if [ -z "$1" ]; then
26 done 30 done
27else 31else
28 if [ "$2" = "delete" ]; then 32 if [ "$2" = "delete" ]; then
29 rm $(target $1) 33 rm -rf $(target $1)
30 else 34 else
31 compile "$1" 35 compile "$1"
32 fi 36 fi
diff --git a/scripts/watch_content.sh b/scripts/watch_content.sh
index 38567dc..60f7b07 100755
--- a/scripts/watch_content.sh
+++ b/scripts/watch_content.sh
@@ -1,12 +1,12 @@
1#!/bin/bash 1#!/bin/bash
2 2
3inotifywait -rme create,close_write,delete,move --format "%f" content \ 3inotifywait -rme create,close_write,delete,move --format "%w%f" content \
4 | while read FILENAME 4 | while read FILENAME
5 do 5 do
6 printf "Change detected: %s\n" "content/$FILENAME" 6 printf "Change detected: %s\n" "$FILENAME"
7 if [ -f "content/$FILENAME" ]; then 7 if [ -f "$FILENAME" ]; then
8 scripts/build_content.sh "content/$FILENAME" 8 scripts/build_content.sh "$FILENAME"
9 else 9 elif [ ! -d "$FILENAME" ]; then
10 scripts/build_content.sh "content/$FILENAME" "delete" 10 scripts/build_content.sh "$FILENAME" "delete"
11 fi 11 fi
12 done 12 done
diff --git a/scripts/watch_sass.sh b/scripts/watch_sass.sh
index 1b99f5d..97fd207 100755
--- a/scripts/watch_sass.sh
+++ b/scripts/watch_sass.sh
@@ -1,8 +1,8 @@
1#!/bin/bash 1#!/bin/bash
2 2
3inotifywait -rme create,close_write,delete,move --format "%f" assets \ 3inotifywait -rme create,close_write,delete,move --format "%w%f" assets \
4 | while read FILENAME 4 | while read FILENAME
5 do 5 do
6 printf "Change detected: %s\n" "assets/$FILENAME" 6 printf "Change detected: %s\n" "$FILENAME"
7 scripts/build_sass.sh 7 scripts/build_sass.sh
8 done 8 done