forked from shuttle-hq/shuttle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupgrade-deps.sh
executable file
·72 lines (55 loc) · 1.23 KB
/
upgrade-deps.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/usr/bin/env bash
#
# Little script to update all cargo dependencies
#
# Dependencies: git, cargo-edit
set -ueo pipefail
function upgrade-workspace()
{
echo "upgrading workspace..."
cargo upgrade --workspace --verbose
cargo check
git commit -am "chore: upgrade workspace dependencies"
}
function upgrade-examples()
{
echo "upgrading examples..."
for d in examples/*/*/;
do
cd "$d"
if [[ -f Cargo.toml ]]
then
rm Cargo.lock
cargo upgrade --verbose
cargo check
cargo clean
fi
cd ../../../
done
git commit -am "docs: upgrade example dependencies"
}
function upgrade-tests-resources()
{
echo "upgrading tests resources..."
for d in service/tests/resources/*/;
do
cd "$d"
if [[ -f Cargo.toml ]]
then
cargo upgrade --verbose
cargo check
cargo clean
fi
cd ../../../../
done
git commit -am "refactor: upgrade tests resources dependencies"
}
function main()
{
git checkout -b "chore/dependencies-upgrades"
upgrade-workspace
upgrade-examples
upgrade-tests-resources
echo "Upgrades all done!!"
}
main "${1-*}"