2020-02-01 11:11:33 +03:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2020-02-18 15:32:21 +03:00
|
|
|
set -e
|
|
|
|
|
2020-02-01 11:11:33 +03:00
|
|
|
usage() {
|
|
|
|
local error="$1"
|
|
|
|
|
|
|
|
cat >&2 <<EOF
|
|
|
|
Usage:
|
|
|
|
$0 PROJECT REV
|
|
|
|
|
|
|
|
Synopsis:
|
|
|
|
Call git-archive(1) to create a release archive of the desired project at the
|
|
|
|
desired revision.
|
|
|
|
|
|
|
|
Outputs a gzipped tarball to the release/ directory.
|
|
|
|
|
|
|
|
Example:
|
|
|
|
$0 urbit v0.10.3
|
|
|
|
|
|
|
|
Error:
|
|
|
|
-> $error
|
|
|
|
EOF
|
|
|
|
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
args="$@"
|
|
|
|
|
|
|
|
if [[ -z "$args" ]]; then
|
|
|
|
usage "No arguments specified."
|
|
|
|
fi
|
|
|
|
|
|
|
|
PROJECT=$1
|
|
|
|
REV=$2
|
|
|
|
|
|
|
|
mkdir -p release
|
|
|
|
|
|
|
|
git archive --prefix="$REV/" \
|
|
|
|
-o release/$REV.tar.gz \
|
|
|
|
$REV:pkg/$PROJECT
|
|
|
|
|