Imported Upstream version 1.8.0
[platform/upstream/git.git] / contrib / mw-to-git / t / install-wiki.sh
1 #!/bin/sh
2
3 # This script installs or deletes a MediaWiki on your computer.
4 # It requires a web server with PHP and SQLite running. In addition, if you
5 # do not have MediaWiki sources on your computer, the option 'install'
6 # downloads them for you.
7 # Please set the CONFIGURATION VARIABLES in ./test-gitmw-lib.sh
8
9 WIKI_TEST_DIR=$(cd "$(dirname "$0")" && pwd)
10
11 if test -z "$WIKI_TEST_DIR"
12 then
13         WIKI_TEST_DIR=.
14 fi
15
16 . "$WIKI_TEST_DIR"/test-gitmw-lib.sh
17 usage () {
18         echo "Usage: "
19         echo "  ./install-wiki.sh <install | delete | --help>"
20         echo "          install | -i :  Install a wiki on your computer."
21         echo "          delete | -d : Delete the wiki and all its pages and "
22         echo "                  content."
23 }
24
25
26 # Argument: install, delete, --help | -h
27 case "$1" in
28         "install" | "-i")
29                 wiki_install
30                 exit 0
31                 ;;
32         "delete" | "-d")
33                 wiki_delete
34                 exit 0
35                 ;;
36         "--help" | "-h")
37                 usage
38                 exit 0
39                 ;;
40         *)
41                 echo "Invalid argument: $1"
42                 usage
43                 exit 1
44                 ;;
45 esac