summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2011-03-15 14:22:37 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2011-03-15 14:22:37 -0700
commite2bbfed10da1753751a1562585d07dc23438449a (patch)
tree902b96fd65e5aca65ac93312827026a1c3bb6154
parentMerge branch 'sp/maint-fd-limit' (diff)
parentgit-instaweb: Change how gitweb.psgi is made runnable as standalone app (diff)
downloadtgif-e2bbfed10da1753751a1562585d07dc23438449a.tar.xz
Merge branch 'jn/maint-instaweb-plack-fix'
* jn/maint-instaweb-plack-fix: git-instaweb: Change how gitweb.psgi is made runnable as standalone app
-rwxr-xr-xgit-instaweb.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/git-instaweb.sh b/git-instaweb.sh
index 10fcebb119..8bfa8a055c 100755
--- a/git-instaweb.sh
+++ b/git-instaweb.sh
@@ -558,12 +558,14 @@ my \$app = builder {
# make it runnable as standalone app,
# like it would be run via 'plackup' utility
-if (__FILE__ eq \$0) {
+if (caller) {
+ return \$app;
+} else {
require Plack::Runner;
my \$runner = Plack::Runner->new();
\$runner->parse_options(qw(--env deployment --port $port),
- "$local" ? qw(--host 127.0.0.1) : ());
+ "$local" ? qw(--host 127.0.0.1) : ());
\$runner->run(\$app);
}
__END__