-
Notifications
You must be signed in to change notification settings - Fork 0
/
mkdist
executable file
·27 lines (26 loc) · 905 Bytes
/
mkdist
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
#!/bin/bash
# This file is part of newrun, copyright © M. Kristall
#
# This program is free software. You can redistribute it and/or modify it under
# the terms of version 2 of the GNU General Public License (GPL) as published by
# the Free Software Foundation.
#
# This program is distributed WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GPL
# for more details.
#
# You should have received a copy of the GPL with this distribution. If not,
# see <http://www.gnu.org/licenses/>.
name="$(basename "$PWD")"
version="$(git log -1 --format=%h)"
name+="-$version"
archive="$name.tar.bz2"
if [ -f "$archive" ]; then
echo "$archive is already ready"
exit
fi
git clone . "$name"
git log --oneline > "$name/ChangeLog"
tar -cjvf "$archive" --recursion "$name" --exclude '*/.git'
rm -rf "$name"
echo "$archive ready for distribution"