-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjustfile
60 lines (45 loc) · 1.26 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
48
49
50
51
52
53
54
55
56
57
58
59
60
set dotenv-load
# List available commands
default:
just -l
alias u := update
alias d := dev
TAILWIND := "./tailwindcss -i ./src/styles/styles.css -o ./assets/styles.css"
# Script to run the Tailwind binary in watch mode
run-tailwind:
#!/bin/bash
echo "Starting the Tailwind binary."
{{ TAILWIND }} --watch
# Script to build and minify the Tailwind binary
build-tailwind:
#!/bin/bash
echo -e "\nMinifying css"
{{ TAILWIND }} --minify'
# Script to run the axum server in watch mode.
run-axum:
#!/bin/bash
echo "Starting the Axum server."
export API_TOKEN=$API_TOKEN
# Start cargo watch in the background
sh -c 'cargo watch -x run'
# Script to run the axum server and tailwind binary in watch mode so updates
# will automatically be reflected. On exit, will minify tailwind's css.
#
# Install Just and run with `just dev`
dev:
#!/bin/bash
minify() {
just build-tailwind
}
# Add a trap to run the minify function before exiting
trap "minify; kill 0" SIGINT
open 'http://127.0.0.1:8080'
just run-axum & just run-tailwind
TAILWIND_PID=$!
wait $TAILWIND_PID
# Update dependencies and run the tests.
update:
#!/bin/bash
cargo update
echo $'Dependencies updated!\n'
cargo test