aboutsummaryrefslogtreecommitdiff
path: root/git-instaweb.sh
diff options
context:
space:
mode:
authorJakub Narebski <jnareb@gmail.com>2011-06-23 22:59:26 +0200
committerEric Wong <normalperson@yhbt.net>2011-06-27 09:11:41 +0000
commitc0175f92c7da1c379c25b5a70d53b9d550bcc11d (patch)
treeb95e1be86954d1b5edc8e196d71e5f5a59b5475f /git-instaweb.sh
parent48bf76ca93c7569660712c12b3c4f86c60803352 (diff)
downloadgit-c0175f92c7da1c379c25b5a70d53b9d550bcc11d.tar.gz
git-c0175f92c7da1c379c25b5a70d53b9d550bcc11d.tar.xz
git-instaweb: Move all actions at the end of script
As a nice side-effect now the order of parameters does not matter: $ git instaweb --httpd=apache2 --start is now (after this patch) the same as $ git instaweb --start --httpd=apache2 Before this commit --start, --stop, --restart (and their subcommand versions start, stop, restart) exited immediately. This is preparatory work for making start/restart check that correct configuration is set up; this change was required to have access in start_httpd to requested web browser etc. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Acked-by: Eric Wong <normalperson@yhbt.net>
Diffstat (limited to 'git-instaweb.sh')
-rwxr-xr-xgit-instaweb.sh27
1 files changed, 20 insertions, 7 deletions
diff --git a/git-instaweb.sh b/git-instaweb.sh
index 2be22a0df..9a2f20f6a 100755
--- a/git-instaweb.sh
+++ b/git-instaweb.sh
@@ -27,6 +27,7 @@ httpd="$(git config --get instaweb.httpd)"
root="$(git config --get instaweb.gitwebdir)"
port=$(git config --get instaweb.port)
module_path="$(git config --get instaweb.modulepath)"
+action="browse"
conf="$GIT_DIR/gitweb/httpd.conf"
@@ -148,17 +149,13 @@ while test $# != 0
do
case "$1" in
--stop|stop)
- stop_httpd
- exit 0
+ action="stop"
;;
--start|start)
- start_httpd
- exit 0
+ action="start"
;;
--restart|restart)
- stop_httpd
- start_httpd
- exit 0
+ action="restart"
;;
-l|--local)
local=true
@@ -611,6 +608,22 @@ configure_httpd() {
esac
}
+case "$action" in
+stop)
+ stop_httpd
+ exit 0
+ ;;
+start)
+ start_httpd
+ exit 0
+ ;;
+restart)
+ stop_httpd
+ start_httpd
+ exit 0
+ ;;
+esac
+
gitweb_conf
resolve_full_httpd