-
Notifications
You must be signed in to change notification settings - Fork 0
/
justfile
45 lines (39 loc) · 1.49 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
default_bin := "tux"
doc: markdown
readme:
#!/usr/bin/env bash
rm -f readme.adoc
asciidoctor-reducer --output readme.adoc ./doc/readme.adoc
echo "// Autogenerated. Edit doc/readme.adoc instead.
$(cat readme.adoc)" >readme.adoc
chmod 0444 readme.adoc
man:
#!/usr/bin/env bash
rm -f ./doc/tux.1
version=$(cargo metadata --format-version 1 | jq -r '.packages[]|select(.name == "tuxmux")|.version')
asciidoctor-reducer --output man.adoc ./doc/man.adoc
asciidoctor --attribute version="$version" --doctype manpage --backend manpage --out-file ./doc/tux.1 man.adoc
chmod 0444 ./doc/tux.1
rm man.adoc
markdown: readme
#!/usr/bin/env bash
rm -f readme.md
asciidoctor -b docbook --out-file readme.xml readme.adoc
pandoc --wrap=none -f docbook -t gfm -o readme.md readme.xml
# The title is lost when converting from asciidoc to docbook
echo "# Tuxmux
$(cat readme.md)" >readme.md
rm readme.xml
chmod 0444 readme.md
release:
#/usr/bin/env bash
cargo build --release --bin tux
mkdir -p release/{completions,man}
cp -f ./{LICENSE,readme.md} ./release
cp -f ./target/release/tux ./release
./release/tux completions bash > ./release/completions/tux.bash
./release/tux completions zsh > ./release/completions/tux
./release/tux completions fish > ./release/completions/tux.fish
./release/tux completions powershell > ./release/completions/tux.ps1
./release/tux completions elvish > ./release/completions/tux.elv
pandoc --standalone --to man doc/tux.md -o release/man/tux.1