sbs

A Simple Blogging System.
git clone https://git.sr.ht/~jbauer/sbs
Log | Files | Refs | README | LICENSE

commit 0878a83fa82ab49fda9ec8447f3394a62ad84b28
parent 7a966eaf612edd92523713dc2ae86981e0058748
Author: Jake Bauer <jbauer@paritybit.ca>
Date:   Tue, 22 Feb 2022 15:26:22 -0500

Add version command

Diffstat:
Msbs | 14++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/sbs b/sbs @@ -6,13 +6,15 @@ # Licensed under the terms of the ISC License, see LICENSE for details. if [ ! -x "$(command -v lowdown)" ]; then - echo "The program 'lowdown' is needed but was not found." - exit 1 + echo "The program 'lowdown' is needed but was not found."; exit 1 fi -if [ -z "$1" ] || [ "$1" = "help" ] || [ "$1" = -h ] || [ "$1" = "--help" ]; then - echo "Usage: sbs <command> [FILE ...]" - exit 0 +if [ -z "$1" ] || [ "$1" = "help" ] || [ "$1" = "-h" ] || [ "$1" = "--help" ]; then + echo "Usage: sbs <command> [FILE ...]"; exit 0 +fi + +if [ "$1" = "version" ] || [ "$1" = "-v" ] || [ "$1" = "--version" ]; then + echo "v0.1.0"; exit 0 fi set -o errexit @@ -76,7 +78,7 @@ if [ "$1" = "new" ]; then exit 0 fi -# Parse the config file +# Parse the config file (everything after this requires the config) options="siteURL siteName blogDir languageCode buildOptions" for key in $options; do value=$(grep "$key" config.ini | cut -d'=' -f2 | xargs)