-
Notifications
You must be signed in to change notification settings - Fork 0
/
justfile
39 lines (31 loc) · 830 Bytes
/
justfile
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
default:
@just --list
# get cargo package version
get-version:
@cargo pkgid | perl -pe '($_)=/([0-9]+([.][0-9]+)+)/'
# run cargo check test and clippy
test:
cargo check
cargo test
cargo clippy
# tag current package version in git
tag:
#!/usr/bin/env bash
set -e
# test just in case
cargo test
version="$(just get-version)"
if [[ -z "$version" ]]; then
echo "Could not read the cargo version"
exit 1
fi
if [[ -n "$(git tag -l "v${version}")" ]]; then
echo "Tag v${version} already exists, did you forget to update Cargo.toml?"
exit 1
fi
if [[ -n "$(git status --porcelain --untracked-files=no)" ]]; then
echo "There are uncommited git changes"
exit 1
fi
echo "Tagging v${version}"
git tag "v${version}"