slackbuilds_ponce/office/ganttproject/ganttproject
2010-05-13 01:00:31 +02:00

25 lines
638 B
Bash

#!/bin/sh
# This script permits calling ganttproject from the /bin directly
# rather than from /opt/ganttproject.
# It supports white spaces in file names.
# Chris Abela <chris.abela@maltats.com>
# Usage: if /bin is in your $PATH, then:
# $ ganttproject "World Domination Project.gan"
# or simply: $ ganttproject
[ $# -gt 1 ] && echo "Sorry! - Only one argument is allowed" && exit
if [ $# -eq 1 ]
then
DIRNAME=`dirname "$1"`
case "$DIRNAME" in
.) DIRNAME="$PWD" ;;
/) unset DIRNAME ;;
esac
BASENAME=`basename "$1"`
cd /opt/ganttproject
./ganttproject.sh "$DIRNAME/$BASENAME"
else
cd /opt/ganttproject
./ganttproject.sh
fi