-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjustfile
38 lines (33 loc) · 913 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
# List all just targets
default:
@just --list
# Apply changes manually
apply:
chezmoi apply --verbose
# Dry run changes
dryrun:
chezmoi apply --dry-run --verbose
# Show diff between source state and destination state
diff:
chezmoi diff
# Watch for changes and apply them
watch:
#!/usr/bin/env bash
export CHEZMOI_SOURCE_PATH="$(chezmoi source-path)"
watchman watch "${CHEZMOI_SOURCE_PATH}"
jq -n \
--arg path "${CHEZMOI_SOURCE_PATH}" \
'[
"trigger",
$path,
{
name: "chezmoi-apply",
command: ["chezmoi", "apply", "--force"]
}
]' | watchman -j
# Stop watching and remove triggers
unwatch:
#!/usr/bin/env bash
CHEZMOI_SOURCE_PATH="$(chezmoi source-path)"
watchman trigger-del "${CHEZMOI_SOURCE_PATH}" chezmoi-apply
watchman watch-del "${CHEZMOI_SOURCE_PATH}"