Skip to content

Commit 34ca0c1

Browse files
authored
Update justfile (#1097)
1 parent a9cbb67 commit 34ca0c1

File tree

2 files changed

+199
-162
lines changed

2 files changed

+199
-162
lines changed

justfile

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
set export := true
22
set dotenv-load := true
33

4+
alias update := upgrade
5+
alias tox := tests
6+
47
EXAMPLE_DIRNAME := "example"
58
VERSION := `sed -n 's/^ *version.*=.*"\([^"]*\)".*/\1/p' pyproject.toml`
69

@@ -14,7 +17,7 @@ VERSION := `sed -n 's/^ *version.*=.*"\([^"]*\)".*/\1/p' pyproject.toml`
1417
[private]
1518
@uv:
1619
if ! command -v uv >/dev/null; then \
17-
echo "Error: 'uv' command is not available"; \
20+
echo "Error - Command 'uv' is not available."; \
1821
exit 1; \
1922
fi
2023

@@ -31,22 +34,20 @@ VERSION := `sed -n 's/^ *version.*=.*"\([^"]*\)".*/\1/p' pyproject.toml`
3134
# Check if the current Git branch is 'main'
3235
[private]
3336
@branch:
34-
if [ "`git rev-parse --abbrev-ref HEAD`" = "main" ]; then \
35-
echo "On branch main."; \
36-
else \
37+
if [ "`git rev-parse --abbrev-ref HEAD`" != "main" ]; then \
3738
echo "Error - Not on branch main."; \
3839
exit 1; \
3940
fi
41+
echo "On branch main.";
4042

41-
# Check if the working directory is clean
43+
# Fail if working directory contains uncommitted or untracked changes
4244
[private]
4345
@porcelain:
44-
if [ -z "`git status --porcelain`" ]; then \
45-
echo "Working directory is clean."; \
46-
else \
47-
echo "Error - working directory is dirty. Commit your changes."; \
46+
if [ -n "`git status --porcelain --untracked-files=all`" ]; then \
47+
echo "Error - Working directory is not clean. Commit your changes."; \
4848
exit 1; \
4949
fi
50+
echo "Working directory is clean.";
5051

5152
# Upgrade and install all dependencies
5253
@upgrade: uv

0 commit comments

Comments
 (0)