Bläddra i källkod

Slightly nicer way to get the BASEDIR

Change-Id: I10d6bfe317653881e4b0af603d44ce2a6a435004
Reviewed-on: http://gerrit.dmdirc.com/1276
Automatic-Compile: DMDirc Local Commits <dmdirc@googlemail.com>
Reviewed-by: Gregory Holmes <greg@dmdirc.com>
tags/0.6.4rc1
Shane Mc Cormack 14 år sedan
förälder
incheckning
ad30b96580

+ 1
- 9
installer/linux/getjre.sh Visa fil

@@ -27,15 +27,7 @@ else
27 27
 fi
28 28
 
29 29
 # Find out where we are
30
-BASEDIR=${0%/*}
31
-if [ "${BASEDIR}" = "${0}" ]; then
32
-	BASEDIR=`which $0`
33
-	BASEDIR=${BASEDIR%/*}
34
-fi
35
-CHECKBASEDIR=`echo "${BASEDIR}" | sed 's#^/##'`
36
-if [ "${CHECKBASEDIR}" = "${BASEDIR}" ]; then
37
-	BASEDIR=${PWD}/${BASEDIR}
38
-fi;
30
+BASEDIR=$(cd "${0%/*}" 2>/dev/null; echo $PWD)
39 31
 
40 32
 PIDOF=`which pidof`
41 33
 if [ "${PIDOF}" = "" ]; then

+ 1
- 9
installer/linux/installjre.sh Visa fil

@@ -42,15 +42,7 @@ else
42 42
 fi
43 43
 
44 44
 # Find out where we are
45
-BASEDIR=${0%/*}
46
-if [ "${BASEDIR}" = "${0}" ]; then
47
-	BASEDIR=`which $0`
48
-	BASEDIR=${BASEDIR%/*}
49
-fi
50
-CHECKBASEDIR=`echo "${BASEDIR}" | sed 's#^/##'`
51
-if [ "${CHECKBASEDIR}" = "${BASEDIR}" ]; then
52
-	BASEDIR=${PWD}/${BASEDIR}
53
-fi;
45
+BASEDIR=$(cd "${0%/*}" 2>/dev/null; echo $PWD)
54 46
 
55 47
 PIDOF=`which pidof`
56 48
 if [ "${PIDOF}" = "" ]; then

+ 1
- 9
installer/linux/setup.sh Visa fil

@@ -47,15 +47,7 @@ else
47 47
 fi
48 48
 
49 49
 # Find out where we are
50
-BASEDIR=${0%/*}
51
-if [ "${BASEDIR}" = "${0}" ]; then
52
-	BASEDIR=`which $0`
53
-	BASEDIR=${BASEDIR%/*}
54
-fi
55
-CHECKBASEDIR=`echo "${BASEDIR}" | sed 's#^/##'`
56
-if [ "${CHECKBASEDIR}" = "${BASEDIR}" ]; then
57
-	BASEDIR=${PWD}/${BASEDIR}
58
-fi;
50
+BASEDIR=$(cd "${0%/*}" 2>/dev/null; echo $PWD)
59 51
 
60 52
 PIDOF=`which pidof`
61 53
 if [ "${PIDOF}" = "" ]; then

+ 1
- 9
installer/linux/uninstall.sh Visa fil

@@ -24,15 +24,7 @@ else
24 24
 fi
25 25
 
26 26
 # Find out where we are
27
-BASEDIR=${0%/*}
28
-if [ "${BASEDIR}" = "${0}" ]; then
29
-	BASEDIR=`which $0`
30
-	BASEDIR=${BASEDIR%/*}
31
-fi
32
-CHECKBASEDIR=`echo "${BASEDIR}" | sed 's#^/##'`
33
-if [ "${CHECKBASEDIR}" = "${BASEDIR}" ]; then
34
-	BASEDIR=${PWD}/${BASEDIR}
35
-fi;
27
+BASEDIR=$(cd "${0%/*}" 2>/dev/null; echo $PWD)
36 28
 
37 29
 if [ ! -e ${BASEDIR}/.uninstall.conf ]; then
38 30
 	echo "No .uninstall.conf found, unable to continue."

+ 1
- 9
launcher/unix/DMDirc.sh Visa fil

@@ -52,15 +52,7 @@ else
52 52
 fi
53 53
 
54 54
 # Find out where we are
55
-BASEDIR=${0%/*}
56
-if [ "${BASEDIR}" = "${0}" ]; then
57
-	BASEDIR=`which $0`
58
-	BASEDIR=${BASEDIR%/*}
59
-fi
60
-CHECKBASEDIR=`echo "${BASEDIR}" | sed 's#^/##'`
61
-if [ "${CHECKBASEDIR}" = "${BASEDIR}" ]; then
62
-	BASEDIR=${PWD}/${BASEDIR}
63
-fi;
55
+BASEDIR=$(cd "${0%/*}" 2>/dev/null; echo $PWD)
64 56
 
65 57
 # Store params so that we can pass them back to the client
66 58
 for param in "$@"; do

+ 1
- 10
updateBundledPlugins.sh Visa fil

@@ -5,16 +5,7 @@
5 5
 # the names and versions to the jar's version.config file.
6 6
 
7 7
 # Find out where we are
8
-BASEDIR=${0%/*}
9
-if [ "${BASEDIR}" = "${0}" ]; then
10
-	BASEDIR=`which $0`
11
-	BASEDIR="${BASEDIR%/*}"
12
-fi
13
-CHECKBASEDIR=`echo "${BASEDIR}" | sed 's#^/##'`
14
-
15
-if [ "${CHECKBASEDIR}" = "${BASEDIR}" -a "${PWD}" != "${CHECKBASEDIR}" -a "${PWD}/." != "${CHECKBASEDIR}" ]; then
16
-	BASEDIR="${PWD}/${BASEDIR}"
17
-fi;
8
+BASEDIR=$(cd "${0%/*}" 2>/dev/null; echo $PWD)
18 9
 
19 10
 if [ -e "${BASEDIR}/build-functions.sh" ]; then
20 11
 	. "${BASEDIR}/build-functions.sh"

Laddar…
Avbryt
Spara