From 53b77e3ae4d3fec39628cfb286f000908cdeaa8f Mon Sep 17 00:00:00 2001 From: B YI Date: Mon, 12 Aug 2019 03:30:35 +0800 Subject: [PATCH] [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/`. --- kodev | 2 +- platform/debian/koreader.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/kodev b/kodev index 578205880..e44e064b7 100755 --- a/kodev +++ b/kodev @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash CURDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" VERSION=$(git describe HEAD) diff --git a/platform/debian/koreader.sh b/platform/debian/koreader.sh index e730e74fb..972969c75 100755 --- a/platform/debian/koreader.sh +++ b/platform/debian/koreader.sh @@ -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