summaryrefslogtreecommitdiff
path: root/office/ganttproject/ganttproject
blob: dee15ada8ed2189b0a90dd9f4059222a21f0bd34 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/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