Skip to content

Commit bc2722f

Browse files
Make koreader Kindle launch script more consistent with other platforms
1 parent 1c111b3 commit bc2722f

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

platform/kindle/koreader.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
export LC_ALL="en_US.UTF-8"
44

5-
if [ ! -n "${UNPACK_DIR+x}" ]; then
6-
UNPACK_DIR='/mnt/us'
7-
fi
8-
# KOReader's working directory.
9-
KOREADER_DIR="${UNPACK_DIR}/koreader"
5+
# Compute our working directory in an extremely defensive manner
6+
SCRIPT_DIR="$(CDPATH='' cd -- "$(dirname -- "$0")" && pwd -P)"
7+
# NOTE: We need to remember the *actual* KOREADER_DIR, not the relocalized version in /tmp...
8+
export KOREADER_DIR="${KOREADER_DIR:-${SCRIPT_DIR}}"
9+
UNPACK_DIR="${KOREADER_DIR%/*}"
1010

1111
# NOTE: Stupid workaround to make sure the script we end up running is a *copy*,
1212
# living in a magical land that doesn't suffer from gross filesystem deficiencies.

0 commit comments

Comments
 (0)