-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathdo
executable file
·50 lines (44 loc) · 1 KB
/
do
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
#! /usr/bin/env nix-shell
#! nix-shell --pure -i bash -p man utillinux git cargo pandoc ronn
set -eux
target="${1:-default}"
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd "$dir"
format_doc () {
pandoc -f gfm -t gfm $1 > $1.tmp
mv $1.tmp $1
}
case "$target" in
default)
echo "Read this script to get a list of valid commands."
;;
doc)
# format docs
format_doc README.md
format_doc ./example/README.md
format_doc ./dist/README.md
# generate man pages.
rm -rf ./man/generated
mkdir -p ./man/generated
cp man/orderly.1.md ./man/generated/
cd ./man/generated
ronn orderly.1.md
rm orderly.1.md
MANWIDTH=100 man -l ./orderly.1 | col -bx > ./orderly.1.txt
;;
test)
cargo build
export PATH="$(pwd)/target/debug/:$PATH"
./test/run_tests
;;
git-push)
git push origin
git push origin --tags
git push github
git push github --tags
;;
*)
echo "Don't know how to do '$target'"
exit 1
;;
esac