From f22c2cefb4c7f8b1a995d5de6f706d49861c473c Mon Sep 17 00:00:00 2001
From: svncommit <devs@roundcube.net>
Date: Tue, 12 May 2009 10:10:30 -0400
Subject: [PATCH] Really, really logout (fixes r2467).

---
 bin/makedoc.sh |   23 ++++++++++++++---------
 1 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/bin/makedoc.sh b/bin/makedoc.sh
index 02bc7a2..26757c0 100755
--- a/bin/makedoc.sh
+++ b/bin/makedoc.sh
@@ -1,4 +1,13 @@
-#!/bin/bash
+#!/usr/bin/env bash
+
+if [ -z "$SSH_TTY" ]
+then
+  if [ -z "$DEV_TTY" ]
+  then
+    echo "Not on the shell."
+    exit 1
+  fi
+fi
 
 TITLE="RoundCube Classes"
 PACKAGES="Core"
@@ -6,15 +15,11 @@
 INSTALL_PATH="`dirname $0`/.."
 PATH_PROJECT=$INSTALL_PATH/program/include
 PATH_DOCS=$INSTALL_PATH/doc/phpdoc
+BIN_PHPDOC="`/usr/bin/which phpdoc`"
 
-if [ -x /usr/local/php5/bin/phpdoc ]
+if [ ! -x "$BIN_PHPDOC" ]
 then
-  PATH_PHPDOC=/usr/local/php5/bin/phpdoc
-elif [ -x /usr/bin/phpdoc ]
-then
-  PATH_PHPDOC=/usr/bin/phpdoc
-else
-  echo "phpdoc not found"
+  echo "phpdoc not found: $BIN_PHPDOC"
   exit 1
 fi
 
@@ -24,6 +29,6 @@
 PRIVATE=off
 
 # make documentation
-$PATH_PHPDOC -d $PATH_PROJECT -t $PATH_DOCS -ti "$TITLE" -dn $PACKAGES \
+$BIN_PHPDOC -d $PATH_PROJECT -t $PATH_DOCS -ti "$TITLE" -dn $PACKAGES \
 -o $OUTPUTFORMAT:$CONVERTER:$TEMPLATE -pp $PRIVATE
 

--
Gitblit v1.9.1