-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJustfile
30 lines (20 loc) · 853 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
# Root justfile for all AoC stuff
mod y2024 '2024/2024.just'
CURRENT_YEAR := "2024"
# Aliases for ANSI color sequences. Makes our output easier to read!
COLOR_GREEN := "\\033[0;32m"
COLOR_STOP := "\\033[0m"
# The result should be `\\[ \\]`, but we need to escape those slashes again here to make it work:
GREP_TARGET := "\\\\[gone\\\\]"
# Show these help docs
help:
@just --list --unsorted --justfile {{ source_file() }}
# Switches to `main` branch, then prunes local branches deleted from remote.
prune_dead_branches:
@echo "{{ COLOR_GREEN }}>> 'Removing dead branches...{{ COLOR_STOP }}"
@git switch main
@git fetch --prune
@git branch -v | grep "{{ GREP_TARGET }}" | awk '{print $1}' | xargs -I{} git branch -D {}
# Add new day for solutions in the current year
new-day DAY:
@just y{{CURRENT_YEAR}}::new-day {{DAY}}