Skip to content

Commit 2c412ba

Browse files
complement.sh: ensure old complement checkout files are deleted; remove -N wget flag (#19592)
1 parent 9edbf56 commit 2c412ba

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

changelog.d/19592.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Ensure old Complement test files are removed when downloading a Complement checkout via `./scripts-dev/complement.sh`.

scripts-dev/complement.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,18 @@ main() {
160160
if [[ -z "$COMPLEMENT_DIR" ]]; then
161161
COMPLEMENT_REF=${COMPLEMENT_REF:-main}
162162
echo "COMPLEMENT_DIR not set. Fetching Complement checkout from ${COMPLEMENT_REF}..."
163-
wget -Nq https://github.com/matrix-org/complement/archive/${COMPLEMENT_REF}.tar.gz
163+
164+
# Download the Complement checkout at the specified ref.
165+
wget -q https://github.com/matrix-org/complement/archive/${COMPLEMENT_REF}.tar.gz
166+
167+
# Delete the existing complement checkout. Otherwise we'll end up with stale
168+
# test files after they're deleted server-side, and `tar` will not delete
169+
# old files.
170+
rm -rf complement-${COMPLEMENT_REF}
171+
172+
# Extract the checkout.
164173
tar -xzf ${COMPLEMENT_REF}.tar.gz
174+
165175
COMPLEMENT_DIR=complement-${COMPLEMENT_REF}
166176
echo "Checkout available at 'complement-${COMPLEMENT_REF}'"
167177
fi

0 commit comments

Comments
 (0)