#!/bin/sh
rm -rf docker-compose
mkdir docker-compose
export GOPATH=`pwd`/docker-compose
git clone https://github.com/docker/compose $GOPATH/src/github.com/docker/compose
git clone https://github.com/docker/compose-switch $GOPATH/src/github.com/docker/compose-switch
( cd $GOPATH/src/github.com/docker/compose
  git checkout -f v2
  go mod download
)
( cd $GOPATH/src/github.com/docker/compose-switch
  go get -v -d
)
tar cf - --exclude .git docker-compose | xz -9 >docker-compose-`date '+%Y%m%d'`.tar.xz
rm -rf docker-compose
