We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent feb27aa commit 7dbce99Copy full SHA for 7dbce99
1 file changed
contrib/update-lock-files.sh
@@ -4,6 +4,28 @@
4
5
set -euo pipefail
6
7
+LOCKFILE="Cargo.lock"
8
+LOCKDIR=".bak"
9
+LOCKFILE_BAK="${LOCKDIR}/${LOCKFILE}"
10
+
11
+cleanup() {
12
+ if [ -f "$LOCKFILE_BAK" ]; then
13
+ mv "$LOCKFILE_BAK" "$LOCKFILE"
14
+ fi
15
+ rmdir "$LOCKDIR"
16
+}
17
18
+if ! mkdir "$LOCKDIR" 2>/dev/null; then
19
+ echo "Another instance is running. If you're sure it's not, remove $LOCKDIR and try again." >&2
20
+ exit 1
21
+fi
22
23
+trap cleanup EXIT
24
25
+if [ -f "$LOCKFILE" ]; then
26
+ mv "$LOCKFILE" "$LOCKFILE_BAK"
27
28
29
for file in Cargo-minimal.lock Cargo-recent.lock; do
30
cp -f "$file" Cargo.lock
31
cargo check
0 commit comments