-
Notifications
You must be signed in to change notification settings - Fork 1
/
runwps
executable file
·44 lines (37 loc) · 899 Bytes
/
runwps
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
scriptname=`basename $0`
product=${scriptname#run}
srcdir=$PWD
bindir=
while [ "$srcdir" != "/" ]; do
if [ -h "$srcdir/build" ]; then
bindir=`readlink "$srcdir/build" -f`
break
fi
srcdir=`dirname "$srcdir"`
done
if [ -z "$bindir" ]; then
bindir=$PWD
while [ "$bindir" != "/" ]; do
if [ -d "$bindir/WPSOffice/office6" ]; then
break
fi
bindir=`dirname "$bindir"`
done
if [ "$bindir" == "/" ]; then
echo "Could not found build path." > /dev/stderr
echo "Go to the root of your src dir and run:" > /dev/stderr
echo "ln -s path_to_your_build_path build" > /dev/stderr
exit 1
fi
fi
if [ ! -d "$bindir" ]; then
echo "Build dir does not exists!" > /dev/stderr
exit 1
fi
if [ ! -f "$bindir/WPSOffice/office6/$product" ]; then
echo "$bindir/WPSOffice/office6/$product does not exists!" > /dev/stderr
exit 1
fi
cd "$bindir/WPSOffice/office6"
./$product "$@"