diff --git a/update.sh b/update.sh index 16c1104c..4974318c 100755 --- a/update.sh +++ b/update.sh @@ -97,7 +97,7 @@ function create_variant() { fi for arch in i386 amd64; do - travisEnv='\n - env: VERSION='"$1"' VARIANT='"$variant"' ARCH='"$arch$travisEnv" + travisEnv=' - env: VERSION='"$1"' VARIANT='"$variant"' ARCH='"$arch"'\n'"$travisEnv" done } @@ -160,9 +160,10 @@ for version in "${versions_beta[@]}"; do fi done +# remove everything after '- stage: test images' +travis="$(awk '!p; /- stage: test images/ {p=1}' .travis.yml)" +echo "$travis" > .travis.yml + # replace the fist '-' with ' ' travisEnv="$(echo "$travisEnv" | sed '0,/-/{s/-/ /}')" - -# update .travis.yml -travis="$(awk -v 'RS=\n\n' '$1 == "-" && $2 == "stage:" && $3 == "test" && $4 == "images" { $0 = " - stage: test images'"$travisEnv"'" } { printf "%s%s", $0, RS }' .travis.yml)" -echo "$travis" > .travis.yml +printf "$travisEnv" >> .travis.yml