mirror of
https://github.com/containers/youki
synced 2024-11-26 06:08:07 +01:00
Fix some problems in the build.sh script
1) Add "set -e" to the script so that we will exit immediately on an error (including on the main "cargo build"). Currently if the actual build fails we will carry on with the script and return success, which makes this hard to use from scripts or from git bisect run. 2) We have two stanzas which remove specific files... only if they already don't exist. This is clearly pointless, so remove them. 3) [ ... ] and [[ ... ]] are essentially synonyms in bash, standardize on just [ ... ] for consistency. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
bf9a22ca10
commit
112d7215d2
11
build.sh
11
build.sh
@ -1,20 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
TARGET=${TARGET-x86_64-unknown-linux-gnu}
|
||||
if [ "$TARGET" != "" ]; then
|
||||
TGT="--target $TARGET"
|
||||
fi
|
||||
VERSION=debug
|
||||
if [[ "$1" == "--release" ]]; then
|
||||
if [ "$1" == "--release" ]; then
|
||||
VERSION=release
|
||||
fi
|
||||
|
||||
cargo build --verbose $TGT $1
|
||||
if [ ! -e ./youki ]; then
|
||||
rm -f youki
|
||||
fi
|
||||
if [ ! -e ./youki_integration_test ]; then
|
||||
rm -f youki_integration_test
|
||||
fi
|
||||
|
||||
cp target/$TARGET/$VERSION/youki .
|
||||
cp target/$TARGET/$VERSION/integration_test ./youki_integration_test
|
||||
|
Loading…
Reference in New Issue
Block a user