#!/bin/bash

set -e

build()
{
    for mod in $@; do
        pushd $mod > /dev/null
        cabal clean
        rm -rf GI
        cabal configure
	cabal build
        cabal install --force-reinstalls
        cabal sdist
        cp dist/*.tar.gz ../sdists
        popd > /dev/null
    done
}

mkdir -p sdists
rm -f sdists/*

build $(./PKGS.sh)

#!/bin/bash

set -e

build()
{
    for mod in $@; do
        pushd $mod > /dev/null
        rm -rf GI
        rm -rf dist
        cabal configure
	cabal build
        cabal install --force-reinstalls
        cabal sdist
        cp dist/*.tar.gz ../sdists
        popd > /dev/null
    done
}

mkdir -p sdists
rm -f sdists/*

build $(./PKGS.sh)

Clean by removing dist dir directly
Clean by removing dist dir directly
