commit 6a549edeee479279e1d94d09968613b0c438edab
parent 2e8714b12567cdbd62fd97cb50861f125641ebc8
Author: zakaria <58356365+e-zk@users.noreply.github.com>
Date: Tue, 16 Mar 2021 19:32:49 +1000
Add shite wrapper script
Diffstat:
M | README | | | 6 | ++++-- |
A | shite | | | 30 | ++++++++++++++++++++++++++++++ |
2 files changed, 34 insertions(+), 2 deletions(-)
diff --git a/README b/README
@@ -1,5 +1,6 @@
shite
=======
+
/bin/sh site generator tools
About
@@ -11,14 +12,15 @@ main functions into serveral scripts:
* rss.sh - rss feed generation
* update.sh - convert new posts from markdown -> html
* index.sh - generate post index (list of posts in chronological order)
+ * shite - simple script that wraps everything into one
The main difference between these scripts and shlog is that these scripts
are easier for _me_ to maintain without worrying about Linux compat,
OS-specific edge cases, etc.
These scripts have been tested on the latest OpenBSD-current and nothing else.
-At this stage, don't expect it to work anywhere else. It is what it claims to
-be; shite.
+At this stage, don't expect it to work anywhere else. Just know that it is
+what it claims to be; shite.
Usage
-------
diff --git a/shite b/shite
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+# dir where shite is installed
+SHITEPATH="${SHITEPATH:-${HOME}/bin/shite/}"
+
+usage() {
+ cat <<EOF
+usage: $(basename $0) [update|index|page] [args ...]
+EOF
+}
+
+case "$1" in
+ "update")
+ shift
+ ${SHITEPATH}/update.sh "$@"
+ ;;
+ "index")
+ shift
+ ${SHITEPATH}/index.sh "$@"
+ ;;
+ "page")
+ shift
+ ${SHITEPATH}/page.sh "$@"
+ ;;
+ *)
+ echo "$(basename $0): `${1}' is a shite command, but not a shite command"
+ usage
+ exit 1
+ ;;
+esac