-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild
executable file
·47 lines (40 loc) · 958 Bytes
/
build
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
#!/usr/bin/env bash
FILES=(
LICENSE
README.md
RATIONALE.md
completions
libexec
man
vim
)
VERSION="$(git tag --sort=version:refname | tail -1 | sed 's/^v//')"
test -n "$VERSION" || VERSION="0.0.1"
if ! command -v ronn >/dev/null 2>&1; then
echo >&2 "Before building, you need to install ronn:"
echo >&2 " https://github.com/rtomayko/ronn/blob/master/INSTALLING"
exit 1
fi
echo >&2 "Generating manpages..."
if ! test -d man; then
mkdir man
fi
rm man/*
ronn --roff ronn/*.*.md
for file in ronn/*.{1,2,3,4,5,6,7}; do
if test -f "$file"; then
man="man/$(basename "$file")"
echo >&2 " move: $file -> $man"
mv "$file" "$man"
fi
done
echo >&2
build="builds/git-topics-$VERSION.tar.gz"
echo >&2 "Generating $build..."
if ! test -d builds; then
mkdir builds
fi
tar -cvzf "$build" "${FILES[@]}" 2> >(sed 's/^/ /')
echo >&2
echo >&2 "Generated $build"
echo >&2 "SHA-256: $(shasum -a 256 "$build" | cut -d' ' -f1)"