[shell] Avoid hard-coded path (#5197)

Although the current hard-coded paths work on debian, they may fail on many other distros. Other distros may pack koreader based on the released deb file. I personally have problem using current script on nixos, as it does not use the paths `/bin/bash` and `/usr/lib/`.
This commit is contained in:
B YI
2019-08-12 03:30:35 +08:00
committed by Frans de Jonge
parent 0a2a1fffe8
commit 53b77e3ae4
2 changed files with 3 additions and 3 deletions

2
kodev
View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
CURDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
VERSION=$(git describe HEAD)

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
export LC_ALL="en_US.UTF-8"
# writable storage: ${HOME}/.config/koreader.
@@ -15,7 +15,7 @@ else
fi
# working directory of koreader
KOREADER_DIR="/usr/lib/koreader"
KOREADER_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/../lib/koreader"
# we're always starting from our working directory
cd "${KOREADER_DIR}" || exit