From b14e9dd4d2979f295562637ce479f7e53d7a1ff0 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Tue, 9 Dec 2014 13:24:24 -0800 Subject: [PATCH] bin: get current directory. --- bin/build-libbitcoind.sh | 7 ++++--- bin/patch-bitcoin.sh | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/bin/build-libbitcoind.sh b/bin/build-libbitcoind.sh index 67ea6244..008cba22 100755 --- a/bin/build-libbitcoind.sh +++ b/bin/build-libbitcoind.sh @@ -1,6 +1,7 @@ #!/bin/sh -cur_dir="$(pwd)" +root_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/.." +cd "$root_dir" os_dir=$(./platform/os.sh osdir) if test -e "${os_dir}/libbitcoind.so"; then @@ -17,7 +18,7 @@ if test -n "$1"; then if test "$1" = 'remote'; then echo 'git clone' git clone git://github.com/bitcoin/bitcoin.git libbitcoind || exit 1 - btc_dir="${cur_dir}/libbitcoind" + btc_dir="${root_dir}/libbitcoind" else btc_dir=$1 if ! test -d "$btc_dir"; then @@ -37,7 +38,7 @@ fi echo "Found BTC directory: $btc_dir" echo './patch-bitcoin.sh' "$btc_dir" -./patch-bitcoin.sh "$btc_dir" || exit 1 +./bin/patch-bitcoin "$btc_dir" || exit 1 cd "$btc_dir" || exit 1 diff --git a/bin/patch-bitcoin.sh b/bin/patch-bitcoin.sh index 0cfd513f..ffcc1ef2 100755 --- a/bin/patch-bitcoin.sh +++ b/bin/patch-bitcoin.sh @@ -1,5 +1,7 @@ #!/bin/sh +root_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/.." +cd "$root_dir" dir=$(test -n "$1" && echo "$1" || echo "${HOME}/bitcoin") patch_file="$(pwd)/bitcoin.patch"