maketarball.sh 443 Bytes
Newer Older
Jakub Sztandera's avatar
Jakub Sztandera committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
#!/usr/bin/env bash
# vim: set expandtab sw=2 ts=2:

# bash safe mode
set -euo pipefail
IFS=$'\n\t'


OUTPUT=$(realpath ${1:-go-ipfs-source.tar.gz})

TMPDIR="$(mktemp -d)"
NEWIPFS="$TMPDIR/github.com/ipfs/go-ipfs"
mkdir -p "$NEWIPFS"
cp -r . "$NEWIPFS"
( cd "$NEWIPFS" &&
  echo $PWD &&
  GOPATH="$TMPDIR" gx install --local &&
  (git rev-parse --short HEAD || true) > .tarball &&
  tar -czf "$OUTPUT" --exclude="./.git" .
)

rm -rf "$TMPDIR"