Skip to content

Commit 2fdca02

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

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

scripts/pre-commit.sh

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

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

822
cargo +nightly --version
923
cargo +nightly fmt --check

0 commit comments

Comments
 (0)