diff --git a/scripts/eosio_build.sh b/scripts/eosio_build.sh index e5a8857488e..4b601804e03 100755 --- a/scripts/eosio_build.sh +++ b/scripts/eosio_build.sh @@ -108,6 +108,9 @@ if [ $# -ne 0 ]; then done fi +# Ensure we're in the repo root and not inside of scripts +cd $( dirname "${BASH_SOURCE[0]}" )/.. + # Load eosio specific helper functions . ./scripts/helpers/eosio.sh diff --git a/tests/bash-bats/eosio_build.sh b/tests/bash-bats/eosio_build.sh index 29a5cf82eda..c2a3cbc8fb8 100644 --- a/tests/bash-bats/eosio_build.sh +++ b/tests/bash-bats/eosio_build.sh @@ -30,11 +30,12 @@ TEST_LABEL="[eosio_build]" [[ ! -z $(echo "${output}" | grep "Unable to find compiler") ]] || exit fi - # -P with -y - run bash -c "./$SCRIPT_LOCATION -y -P" + cd .. # Also test that we can run the script from a directory other than the root + run bash -c "./eos/$SCRIPT_LOCATION -y -P" [[ ! -z $(echo "${output}" | grep "PIN_COMPILER: true") ]] || exit [[ "${output}" =~ -DCMAKE_TOOLCHAIN_FILE=\'.*/scripts/../build/pinned_toolchain.cmake\' ]] || exit [[ "${output}" =~ "Clang 8 successfully installed" ]] || exit + cd eos # -P with prompts run bash -c "printf \"n\nn\nn\n\" | ./$SCRIPT_LOCATION -P" [[ "${output}" =~ .*User.aborted.* ]] || exit