From: henoheno Date: Sun, 9 Jan 2005 04:07:04 +0000 (+0900) Subject: tDiary demonstration generator: generates many [theme].php X-Git-Tag: git_support~61 X-Git-Url: http://git.osdn.net/view?p=pukiwiki%2Fpukiwiki_devel.git;a=commitdiff_plain;h=09248a0e25596dc499d32add15a844514a963929 tDiary demonstration generator: generates many [theme].php --- diff --git a/tdiary-demogen.sh b/tdiary-demogen.sh new file mode 100644 index 0000000..5560795 --- /dev/null +++ b/tdiary-demogen.sh @@ -0,0 +1,63 @@ +#!/bin/sh +# $Id: tdiary-demogen.sh,v 1.1 2005/01/09 04:07:04 henoheno Exp $ +# +# tDiary demonstrator generator +# License: GPL + +usage(){ + base="`basename $0`"; + echo " $base [-d path/to/theme-directory] list" + echo " $base [-d path/to/theme-directory] interwiki [URI]" + echo " $base [-d path/to/theme-directory] touch" + echo " Command:" + echo " lis|listt - List theme" + echo " int|interwiki - Publish interwiki definition and setting for each theme" + echo " tou|touch - Generate \$theme.php that includes index.php" +} + +theme_list(){ + cd "$dir" || echo "Error: directory '$dir' not found"; + ls -1 | while read theme; do + test -f "$theme/$theme.css" && echo "$theme" + done +} + +# ---- Argument check ---- +dir="skin/theme" +if [ "x-d" = "x$1" ] ; then + dir="$2" + shift 2 +fi +cmd="$1" + +# ---- + +case "$cmd" in +''|-h|hel|help ) usage ;; +lis|list ) theme_list ;; + +int|inte|inter|interw|interwi|interwik|interwiki) + echo '--------' + echo '- [./$1.php theme] raw tDiary theme selector' + echo '--------' + theme_list | while read theme; do + echo "[[theme:$theme]]" + done + ;; + +tou|touc|touch ) + theme_list | while read theme; do + if [ -f "$theme.php" ] + then echo "Warning: '$theme.php' is already available. Ignoreing..." + else + cat < "$theme.php" + +EOF + fi + done + ;; +esac +