Skip to content

Commit a7fbe30

Browse files
committed
Try download deps from git in CI
1 parent 75034d6 commit a7fbe30

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

scripts/pre-commit.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,23 @@
33
export RUSTFLAGS="-Dwarnings"
44
export RUSTDOCFLAGS="--cfg docsrs -Dwarnings"
55

6+
declare -A LOCALDEPS=(
7+
[hightorrent]="https://github.com/angrynode/hightorrent"
8+
)
9+
610
set -e
11+
set -x
12+
13+
if [[ "$1" = "tag" ]]; then
14+
# When testing for a tag, we only want to use released versions on crates.io
15+
cp Cargo.toml Cargo.toml.bak
16+
sed -ri 's/, ?path ?= ?".*"//' Cargo.toml
17+
else
18+
# If testing in CI, we want to download the latest main branch of LOCALDEPS
19+
for dep in ${!LOCALDEPS[@]}; do
20+
git clone --depth=1 "${LOCALDEPS[${key}]}" ../$dep
21+
done
22+
fi
723

824
cargo +nightly --version
925
cargo +nightly fmt --check

0 commit comments

Comments
 (0)