git.iko.soy/typeable/servant
on v0.4.1 help sign in
typeable/servant/scripts/start-sandbox.sh
30 lines 776 B history raw
1#!/bin/bash -
2#===============================================================================
3#
4# FILE: start-sandbox.sh
5#
6# USAGE: ./start-sandbox.sh
7#
8# DESCRIPTION: Create sandbox at top-level and add all packages as add-source
9#
10# REQUIREMENTS: bash >= 4
11#===============================================================================
13set -o nounset
14set -o errexit
16DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
17SOURCES_TXT="$( dirname $DIR)/sources.txt"
18CABAL=${CABAL:-cabal}
20declare -a SOURCES
21readarray -t SOURCES < "$SOURCES_TXT"
23prepare_sandbox () {
24 $CABAL sandbox init
25 for s in ${SOURCES[@]} ; do
26 (cd "$s" && $CABAL sandbox init --sandbox=../.cabal-sandbox && $CABAL sandbox add-source .)
27 done
30prepare_sandbox