summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
Diffstat (limited to 'script')
-rwxr-xr-xscript/check29
-rwxr-xr-xscript/check-links15
-rwxr-xr-xscript/check-online21
-rwxr-xr-xscript/deploy7
4 files changed, 38 insertions, 34 deletions
diff --git a/script/check b/script/check
index 6428077..a7de23f 100755
--- a/script/check
+++ b/script/check
@@ -1,21 +1,16 @@
#! /bin/sh
-# Run third-party markup checkers.
-# See W3C Developer Tools at https://w3c.github.io/developers/tools/
+set -o errexit
+set -o nounset
+set -o xtrace
-open() {
- xdg-open "$@" >/dev/null 2>&1 &
-}
+cabal v2-run exe:site -- rebuild
-# W3C Nu HTML Checker
-open "https://validator.w3.org/nu/?doc=https%3A%2F%2Fwww.skreutz.com%2Fposts%2Funix-domain-socket-forwarding-with-openssh%2F"
-
-# W3C CSS Validator
-open "https://jigsaw.w3.org/css-validator/validator?uri=https%3A%2F%2Fwww.skreutz.com%2F&profile=css3svg&usermedium=all&warning=1&vextwarning=&lang=en"
-
-# W3C Feed Validator
-open "https://validator.w3.org/feed/check.cgi?url=https%3A%2F%2Fwww.skreutz.com%2Ffeeds%2Fposts.rss"
-open "https://validator.w3.org/feed/check.cgi?url=https%3A%2F%2Fwww.skreutz.com%2Ffeeds%2Fposts.atom"
-
-# W3C Link Checker
-open "https://validator.w3.org/checklink?uri=https%3A%2F%2Fwww.skreutz.com%2F&hide_type=all&recursive=on&depth=10&check=Check"
+# See also .lycheeignore file.
+lychee \
+ --exclude-link-local \
+ --exclude-loopback \
+ --exclude-mail \
+ --exclude-private \
+ --format detailed \
+ _site/
diff --git a/script/check-links b/script/check-links
deleted file mode 100755
index e745f78..0000000
--- a/script/check-links
+++ /dev/null
@@ -1,15 +0,0 @@
-#! /bin/sh
-
-set -o errexit
-set -o nounset
-set -o xtrace
-
-cabal v2-run exe:site -- rebuild
-lychee \
- --exclude-link-local \
- --exclude-loopback \
- --exclude-mail \
- --exclude-private \
- --format detailed \
- --verbose \
- _site/
diff --git a/script/check-online b/script/check-online
new file mode 100755
index 0000000..6428077
--- /dev/null
+++ b/script/check-online
@@ -0,0 +1,21 @@
+#! /bin/sh
+
+# Run third-party markup checkers.
+# See W3C Developer Tools at https://w3c.github.io/developers/tools/
+
+open() {
+ xdg-open "$@" >/dev/null 2>&1 &
+}
+
+# W3C Nu HTML Checker
+open "https://validator.w3.org/nu/?doc=https%3A%2F%2Fwww.skreutz.com%2Fposts%2Funix-domain-socket-forwarding-with-openssh%2F"
+
+# W3C CSS Validator
+open "https://jigsaw.w3.org/css-validator/validator?uri=https%3A%2F%2Fwww.skreutz.com%2F&profile=css3svg&usermedium=all&warning=1&vextwarning=&lang=en"
+
+# W3C Feed Validator
+open "https://validator.w3.org/feed/check.cgi?url=https%3A%2F%2Fwww.skreutz.com%2Ffeeds%2Fposts.rss"
+open "https://validator.w3.org/feed/check.cgi?url=https%3A%2F%2Fwww.skreutz.com%2Ffeeds%2Fposts.atom"
+
+# W3C Link Checker
+open "https://validator.w3.org/checklink?uri=https%3A%2F%2Fwww.skreutz.com%2F&hide_type=all&recursive=on&depth=10&check=Check"
diff --git a/script/deploy b/script/deploy
index ec2a6f3..40a36a9 100755
--- a/script/deploy
+++ b/script/deploy
@@ -30,6 +30,9 @@ printf "Re-generating static website from source ...\\n"
&& cabal v2-run exe:site -- clean >/dev/null 2>&1 \
&& cabal v2-run exe:site -- build >/dev/null 2>&1 )
+printf "Running checks ...\\n"
+( cd "${root}" && ./script/check )
+
[ -z "$( git status --porcelain )" ] || {
( >&2 printf "error: dirty working tree\\n" )
printf "Aborting deployment due to unstaged changes or untracked files.\\n"
@@ -55,5 +58,5 @@ curl \
http://www.bing.com/ping?sitemap=https%3A%2F%2Fwww.skreutz.com/sitemap.xml \
|| ( >&2 printf "error: failed to submit live sitemap to bing.com\\n" )
-# shellcheck source=./check
-. "${root}/script/check"
+# shellcheck source=./check-online
+. "${root}/script/check-online"
Generated by cgit. See skreutz.com for my tech blog and contact information.