-
Notifications
You must be signed in to change notification settings - Fork 0
/
justfile
executable file
·35 lines (29 loc) · 1.12 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
#!/usr/bin/env -S just --justfile
# Allows justfile to be executed like a script, e.g. `./justfile test`
export project_root := `git rev-parse --show-toplevel`
src_dir := "./src"
mdbook_summary_file := "SUMMARY.md"
_default:
@just --list
# Generate mdbook SUMMARY.md from files structure
generate-mdbook-summary input_dir=src_dir output_file=mdbook_summary_file:
{{ project_root }}/bin/generate-mdbook-summary {{ input_dir }} {{ output_file }}
# Start the mdbook server
dev: generate-mdbook-summary
mdbook serve --watcher=native
# Check syntax of `justfile` and `.just` files
just-check:
#!/usr/bin/bash
find "${project_root}" -type f -name "*.just" | while read -r file; do
echo "Checking syntax: $file"
just --unstable --fmt --check -f $file
done
just --unstable --fmt --check -f ${project_root}/justfile
# Fix syntax of `justfile` and `.just` files
just-fix:
#!/usr/bin/bash
find "${project_root}" -type f -name "*.just" | while read -r file; do
echo "Checking syntax: $file"
just --unstable --fmt -f $file
done
just --unstable --fmt -f ${project_root}/justfile