-
Notifications
You must be signed in to change notification settings - Fork 0
/
justfile
82 lines (66 loc) · 1.86 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# www-chicks-net justfile
# some useful variables
host := `uname -n`
release_branch := "main"
# thanks to https://stackoverflow.com/a/7293026/2002471 for the perfect git incantation
last_commit_message := `git log -1 --pretty=%B | grep '.'`
# default works without naming it
[group('example')]
whatever:
just --list
# goofing off
[group('example')]
cause:
@echo haha on {{ host }} running {{ os() }}
@echo "invocation_dir={{ invocation_directory() }}"
git stp
# escape from branch, back to starting point
[group('Process')]
sync:
git checkout main
git pull
# PR create
[group('Process')]
pr: on_a_branch
hugo
git stp
git pushup
gh pr create --title "{{ last_commit_message }}" --body "{{ last_commit_message }} (Automated in 'justfile'.)"
# merge PR and return to starting point
[group('Process')]
merge:
gh pr merge -s
just sync
#test: on_a_branch
# echo gh pr create --title "{{last_commit_message}}" --body "{{last_commit_message}}\nAutomated in 'justfile'."
# TODO: sanity check for making sure there are commits on the branch
# error if not on a git branch
[group('sanity check')]
[no-cd]
on_a_branch:
#!/bin/bash
# thanks to https://stackoverflow.com/a/12142066/2002471
if [[ $(git rev-parse --abbrev-ref HEAD) == "main" ]]; then
echo "You are on branch {{ release_branch }} (the release branch) so you are not ready to start a PR."
exit 100
fi
# Thanks to https://apple.stackexchange.com/a/422206/210526
# remove GPS information from an image
[group('Utility')]
[no-cd]
gps_rm image:
exiftool -overwrite_original -gps:all= {{ image }}
# from ancient html/Makefile
#favicon.ico: img/favicon.pnm
# ppmtowinicon -output favicon.ico favicon.pnm
# print UTC date/time
[group('Utility')]
[no-cd]
@utcdate:
TZ=UTC date
# test network speed
[group('Utility')]
[no-cd]
[macos]
speedtest:
networkQuality