2 # $Id: tdiary-demogen.sh,v 1.1 2005/01/09 04:07:04 henoheno Exp $
4 # tDiary demonstrator generator
9 echo " $base [-d path/to/theme-directory] list"
10 echo " $base [-d path/to/theme-directory] interwiki [URI]"
11 echo " $base [-d path/to/theme-directory] touch"
13 echo " lis|listt - List theme"
14 echo " int|interwiki - Publish interwiki definition and setting for each theme"
15 echo " tou|touch - Generate \$theme.php that includes index.php"
19 cd "$dir" || echo "Error: directory '$dir' not found";
20 ls -1 | while read theme; do
21 test -f "$theme/$theme.css" && echo "$theme"
25 # ---- Argument check ----
27 if [ "x-d" = "x$1" ] ; then
36 ''|-h|hel|help ) usage ;;
37 lis|list ) theme_list ;;
39 int|inte|inter|interw|interwi|interwik|interwiki)
41 echo '- [./$1.php theme] raw tDiary theme selector'
43 theme_list | while read theme; do
44 echo "[[theme:$theme]]"
49 theme_list | while read theme; do
50 if [ -f "$theme.php" ]
51 then echo "Warning: '$theme.php' is already available. Ignoreing..."
53 cat <<EOF > "$theme.php"
55 define('TDIARY_THEME', '$theme');
56 require('./index.php')