Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

executable file 35 lines (27 sloc) 0.796 kb
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 28 29 30 31 32 33 34 35
#!/bin/bash

set -e

subdir="$1"
out="$2"
top="$PWD"
builddir="$(mktemp -d -t lockerbuild.XXXX)"

rm -rf "$builddir"
mkdir -p "$builddir/$subdir"

trap "rm -rf \"$builddir\"" EXIT

# fetch a clean copy of the code from git
echo "Fetching code..."
# This doesn't work anymore with submodules. I hate submodules.
git archive HEAD | tar -x -C "$builddir/$subdir"
git submodule foreach --quiet 'echo $path' | while read submodule; do
    dest="$builddir/$subdir/$submodule"
    mkdir -p "$dest"
    (cd "$submodule" &&
     echo "Submodule $submodule at revision" $(git rev-parse HEAD) &&
     git archive HEAD | tar -x -C "$dest"
    )
done

make -C "$builddir/$subdir"
mkdir -p "$builddir/$subdir/Me"

echo "Compressing..."
(cd "$builddir"; tar czf - "$subdir") > "$out"

echo "Done."
echo "$out"
Something went wrong with that request. Please try again.