shrub/sh/release-archive
Jared Tobin 9c644c4333
sh: add release-archive script [ci skip]
Adds a simple helper script for creating release archives.
2020-02-01 12:11:33 +04:00

41 lines
523 B
Bash
Executable File

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