summaryrefslogtreecommitdiffstats
path: root/make-release.sh
blob: aee045ec806f802e703cbd3720b30311f2eec76d (plain)
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/sh

PKG="openlmi-providers"

if [ $# -lt 1 ];
then
    printf "Usage: %s VERSION\n" $0
    exit 1
fi

VERSION=$1

git tag | grep --silent "^$VERSION$"

if [ $? -ne 0 ];
then
    printf "No such tag: $VERSION\n"
    exit 2
fi

if [ -f "$PKG-$VERSION.tar.gz" ];
then
    printf "Archive $PKG-$VERSION.tar.gz already exists\n"
    exit 3
fi

exec git archive --format=tar --prefix=$PKG-$VERSION/ $VERSION | gzip > $PKG-$VERSION.tar.gz