about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorBen Morrison <ben@gbmor.dev>2020-06-30 02:41:39 -0400
committerBen Morrison <ben@gbmor.dev>2020-06-30 02:41:39 -0400
commit11d8fc7ce1a2ff86ca5943889c22385b3c3bf970 (patch)
tree1a2583be0b7c3ce081d2778fc007a94fa8601209
parent5db8118b173d9ff0c4bc2d2c55e72967090ad991 (diff)
downloadsite-11d8fc7ce1a2ff86ca5943889c22385b3c3bf970.tar.gz
made those eldritch monstrosities of sed incantations more readable
-rwxr-xr-xbuild.sh14
1 files changed, 11 insertions, 3 deletions
diff --git a/build.sh b/build.sh
index 841ba8f..0c54a4c 100755
--- a/build.sh
+++ b/build.sh
@@ -12,10 +12,18 @@ build()
 		printf '\n%s %s\n' 'Building:' "$FILENAME"
 
 		if [ "$FILENAME" != 'index.html' ]; then
-			sed '/{{HEADER}}/r inc/_header.html' "$FILE" | sed '/{{HEADER}}/D' | sed '/{{LOGONAV}}/r inc/_logonav.html' | sed '/{{LOGONAV}}/D' > "dist/$FILENAME"
+			sed '/{{HEADER}}/r inc/_header.html' "$FILE" |\
+			sed '/{{HEADER}}/D' |\
+			sed '/{{LOGONAV}}/r inc/_logonav.html' |\
+			sed '/{{LOGONAV}}/D' > "dist/$FILENAME"
 		else
-		    sed '/{{HEADER}}/r inc/_header.html' "$FILE" | sed '/{{HEADER}}/D' | sed '/{{LOGONAV}}/r inc/_logonav.html' | sed '/{{LOGONAV}}/D' | sed '/{{NEWS}}/r inc/_news.html' | sed '/{{NEWS}}/D' > "dist/$FILENAME"
-        fi
+		    sed '/{{HEADER}}/r inc/_header.html' "$FILE" |\
+			sed '/{{HEADER}}/D' |\
+			sed '/{{LOGONAV}}/r inc/_logonav.html' |\
+			sed '/{{LOGONAV}}/D' |\
+			sed '/{{NEWS}}/r inc/_news.html' |\
+			sed '/{{NEWS}}/D' > "dist/$FILENAME"
+		fi
 	done
 
 	cp assets/* dist/