aboutsummaryrefslogtreecommitdiff
path: root/tests/common/git/pack
blob: fd0b49c6bd65a1b4edc11aa592c0cbfa17fedc80 (plain)
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
#! /bin/sh

# Move git projects to tar archives.
#
# Usage example:
#
# ./pack
#
owd=`pwd`
trap "{ cd $owd; exit 1; }" ERR
set -o errtrace # Trap in functions.

function info () { echo "$*" 1>&2; }
function error () { info "$*"; exit 1; }

projects=(\
  state0/libfoo state0/libfox state0/libbar state0/style state0/style-basic \
  state0/links \
  state1/libfoo state1/libfox state1/libbaz state1/style state1/style-basic)

for p in "${projects[@]}"; do
  d=$p.git
  if [ ! -d $d ]; then
    error "$d directory not found"
  fi

  git -C $d submodule sync --recursive

  tar cf $p.tar $d
  rm -r -f $d
done