summaryrefslogtreecommitdiff
path: root/desktop/scripts/soffice.sh
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-02-11 12:54:24 +0100
committerStephan Bergmann <sbergman@redhat.com>2017-02-11 12:54:24 +0100
commit709709962d09a22c9594c7a440c6543ad4843ecf (patch)
tree687a2d8d43ad2822f3644091cdcd2e2de769bf6f /desktop/scripts/soffice.sh
parentad849f4bdad957dae30fa17975d9aac3ab5e8299 (diff)
Upon failure, 'cd' itself already prints a message to stderr
Change-Id: Iabe3a6bb14ca3e83a0792d7fc131ae0ac74e578c
Diffstat (limited to 'desktop/scripts/soffice.sh')
-rwxr-xr-xdesktop/scripts/soffice.sh13
1 files changed, 3 insertions, 10 deletions
diff --git a/desktop/scripts/soffice.sh b/desktop/scripts/soffice.sh
index f855fe79e8bf..b73d6b30a2e6 100755
--- a/desktop/scripts/soffice.sh
+++ b/desktop/scripts/soffice.sh
@@ -39,26 +39,19 @@ export SAL_ENABLE_FILE_LOCKING
#@JITC_PROCESSOR_TYPE_EXPORT@
-cd_or_exit() {
- if ! cd "$1"; then
- echo "Can't cd to $1"
- exit 1
- fi
-}
-
# resolve installation directory
sd_cwd=$(pwd)
sd_res="$0"
while [ -h "$sd_res" ] ; do
sd_dirname=$(dirname "$sd_res")
- cd_or_exit "$sd_dirname"
+ cd "$sd_dirname" || exit $?
sd_basename=$(basename "$sd_res")
sd_res=$(ls -l "$sd_basename" | sed "s/.*$sd_basename -> //g")
done
sd_dirname=$(dirname "$sd_res")
-cd_or_exit "$sd_dirname"
+cd "$sd_dirname" || exit $?
sd_prog=$(pwd)
-cd_or_exit "$sd_cwd"
+cd "$sd_cwd" || exit $?
# linked build needs additional settings
if [ -e "${sd_prog}/ooenv" ] ; then