forked from westerveltco/django-twc-package
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Justfile
47 lines (35 loc) · 1.07 KB
/
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
40
41
42
43
44
45
46
47
set dotenv-load := true
@_default:
just --list
bootstrap *ARGS:
rye sync {{ ARGS }}
lock *ARGS:
rye lock {{ ARGS }}
# ----------------------------------------------------------------------
# EXAMPLES
# ----------------------------------------------------------------------
# generate all examples from examples/*.yml copier answer files
@generate-examples:
for file in `ls examples/*.yml`; do \
just _generate-example $file; \
done
_generate-example DATA_FILE:
#!/usr/bin/env bash
set -euo pipefail
DIRECTORY="{{ trim_end_match(DATA_FILE, '.yml') }}"
rm -rf $DIRECTORY
COMMAND="copier copy -r HEAD . $DIRECTORY --force --trust --data-file {{ DATA_FILE }}"
if [ -z "$(command -v rye)" ]; then
eval $COMMAND
else
rye run $COMMAND
fi
# ----------------------------------------------------------------------
# UTILS
# ----------------------------------------------------------------------
# format justfile
fmt:
just --fmt --unstable
# run pre-commit on all files
lint:
rye run pre-commit run --all-files