1
1
mirror of https://github.com/urbit/shrub.git synced 2024-12-26 13:31:36 +03:00
shrub/sh/release-archive
Jared Tobin 915bf1332f
sh/release-archive: 'set -e' in header [ci skip]
Bail out on encountering any errors.
2020-02-18 16:32:21 +04:00

43 lines
531 B
Bash
Executable File

#!/usr/bin/env bash
set -e
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