mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-06-03 07:04:07 +00:00
a bit more docs
This commit is contained in:
parent
45f7b6cc45
commit
fcf65433ea
22
bin/serve.sh
22
bin/serve.sh
@ -4,25 +4,20 @@
|
|||||||
# It respects the TIDDLYWIKI_EDITION_PATH variable described
|
# It respects the TIDDLYWIKI_EDITION_PATH variable described
|
||||||
# at: # http://tiddlywiki.com/#Environment%20Variables%20on%20Node.js
|
# at: # http://tiddlywiki.com/#Environment%20Variables%20on%20Node.js
|
||||||
#
|
#
|
||||||
# Be sure your server tiddlywiki.info configuration contains the
|
# Be sure your server tiddlywiki.info configuration contains the plugins:
|
||||||
# - "tiddlywiki/tiddlyweb" and the "tiddlywiki/filesystem" plugins.
|
# - "tiddlywiki/tiddlyweb" and the "tiddlywiki/filesystem"
|
||||||
# Otherwise saving is not possible.
|
# - Otherwise saving is not possible.
|
||||||
|
|
||||||
# global settings
|
# global settings
|
||||||
# set -o nounset #exit if a variable is not set
|
# set -o nounset #exit if a variable is not set
|
||||||
set -o errexit #exit on error
|
set -o errexit #exit on error
|
||||||
|
|
||||||
# get command naem and path info needed for help text
|
# get command name and path info needed for help text
|
||||||
ARG0=$(basename $0)
|
ARG0=$(basename $0)
|
||||||
#ARG0DIR=$(dirname $0)
|
#ARG0DIR=$(dirname $0)
|
||||||
#[ $ARG0DIR == "." ] && ARG0DIR=$PWD
|
#[ $ARG0DIR == "." ] && ARG0DIR=$PWD
|
||||||
|
|
||||||
# ---- helper functions ----
|
# ---- helper functions ----
|
||||||
_log () {
|
|
||||||
echo
|
|
||||||
echo "---> $1"
|
|
||||||
}
|
|
||||||
|
|
||||||
version () {
|
version () {
|
||||||
echo "$ARG0, TiddlyWiki serve script version 0.0.1"
|
echo "$ARG0, TiddlyWiki serve script version 0.0.1"
|
||||||
echo
|
echo
|
||||||
@ -54,6 +49,11 @@ help() {
|
|||||||
echo
|
echo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_log () {
|
||||||
|
echo
|
||||||
|
echo "---> $1"
|
||||||
|
}
|
||||||
|
|
||||||
# error handling
|
# error handling
|
||||||
error() {
|
error() {
|
||||||
echo "$ARG0: $*" 1>&2
|
echo "$ARG0: $*" 1>&2
|
||||||
@ -72,6 +72,7 @@ serve () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
check_edition_directory () {
|
check_edition_directory () {
|
||||||
|
# The editions directory must exist and should contain a tiddlywiki.info file
|
||||||
if [ ! -d $TIDDLYWIKI_EDITION_PATH ]; then
|
if [ ! -d $TIDDLYWIKI_EDITION_PATH ]; then
|
||||||
_log "Edition directory: '$TIDDLYWIKI_EDITION_PATH' doesn't exist. Create it!"
|
_log "Edition directory: '$TIDDLYWIKI_EDITION_PATH' doesn't exist. Create it!"
|
||||||
exit 1
|
exit 1
|
||||||
@ -94,7 +95,7 @@ shift $(expr $OPTIND - 1)
|
|||||||
|
|
||||||
#----------------------------------------------------
|
#----------------------------------------------------
|
||||||
|
|
||||||
# If no edition parameter is provided, use defaults
|
# If no edition parameter is provided, use Jeremy's defaults
|
||||||
if [ $# -eq 0 ]; then
|
if [ $# -eq 0 ]; then
|
||||||
# check if the edition path environment variable is set. If yes use it.
|
# check if the edition path environment variable is set. If yes use it.
|
||||||
[ -z $TIDDLYWIKI_EDITION_PATH ] && TIDDLYWIKI_EDITION_PATH="./editions/tw5.com-server"
|
[ -z $TIDDLYWIKI_EDITION_PATH ] && TIDDLYWIKI_EDITION_PATH="./editions/tw5.com-server"
|
||||||
@ -119,4 +120,3 @@ else
|
|||||||
|
|
||||||
serve "$TIDDLYWIKI_EDITION_PATH" "$2" "$3" "$4" $PORT
|
serve "$TIDDLYWIKI_EDITION_PATH" "$2" "$3" "$4" $PORT
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user