We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1c111b3 commit bc2722fCopy full SHA for bc2722f
1 file changed
platform/kindle/koreader.sh
@@ -2,11 +2,11 @@
2
3
export LC_ALL="en_US.UTF-8"
4
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"
+# Compute our working directory in an extremely defensive manner
+SCRIPT_DIR="$(CDPATH='' cd -- "$(dirname -- "$0")" && pwd -P)"
+# NOTE: We need to remember the *actual* KOREADER_DIR, not the relocalized version in /tmp...
+export KOREADER_DIR="${KOREADER_DIR:-${SCRIPT_DIR}}"
+UNPACK_DIR="${KOREADER_DIR%/*}"
10
11
# NOTE: Stupid workaround to make sure the script we end up running is a *copy*,
12
# living in a magical land that doesn't suffer from gross filesystem deficiencies.
0 commit comments