Files
oasis-linux-mirror/scripts/commit.sh
Michael Forney 741d252822 Port build scripts to POSIX shell
Since we are now using Lua to generate ninja files, use of rc in build scripts
seems unnecessary and adds an additional bootstrap dependency. None of them are
too fancy, so just port to POSIX sh instead.
2018-02-16 02:52:34 -08:00

17 lines
333 B
Bash

set -e
repo=$1
branch=$2
tag=$3
out=$4
if git -C "$repo" show-ref -q --verify "refs/heads/$branch" ; then
set -- -p "$branch"
else
set --
fi
commit=$(git -C "$repo" commit-tree -m "oasis built by $(id -un)" "$@" "$tag")
git -C "$repo" update-ref "refs/heads/$branch" "$commit"
echo "$commit" >"$out.tmp" && mv "$out.tmp" "$out"