From 53e9db2f42bf4b6ad593e20aed708bd9f306724c Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Sat, 6 Apr 2019 22:14:12 +0300 Subject: [PATCH] scripts/test.sh: export the rust binaries iniside flatpak environments This allows the script to be able to be run directly from GNOME Builder's build terminals. --- scripts/test.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/test.sh b/scripts/test.sh index 35ed241..36faa9c 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -4,6 +4,15 @@ set -o errexit set -o pipefail export CARGO_TARGET_DIR="$1/target/" + +# If this is run inside a flatpak envrironment, append the export the rustc +# sdk-extension binaries to the path +if [ -n "/.flatpak-info" ] +then + export PATH="$PATH:/usr/lib/sdk/rust-stable/bin" + export CARGO_TARGET_DIR="$BUILDDIR/target/" +fi + export CARGO_HOME="$CARGO_TARGET_DIR/cargo-home" cargo test -j 1 -- --test-threads=1 --nocapture