Skip to content

Instantly share code, notes, and snippets.

@colinmollenhour
Forked from syhe/simple_modman_test.sh
Last active April 26, 2017 15:35
Show Gist options
  • Save colinmollenhour/59430611cb7c3dfde256ee6f68df7b0a to your computer and use it in GitHub Desktop.
Save colinmollenhour/59430611cb7c3dfde256ee6f68df7b0a to your computer and use it in GitHub Desktop.
Simple modman test
#!/usr/bin/env bash
set -e
MODMAN="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/modman"
TMPDIR=$(mktemp -d)
function cleanup () {
rm -rfv "$TMPDIR"
}
trap cleanup EXIT
modmandir=".modman"
cd "$TMPDIR"
mkdir base
$MODMAN init
mkdir $modmandir/Test_Module
touch $modmandir/Test_Module/modman
echo "src/testfile testlink" > $modmandir/Test_Module/modman
mkdir $modmandir/Test_Module/src
touch $modmandir/Test_Module/src/testfile
echo "base" > $modmandir/Test_Module/.basedir # Same result as `modman clone Test_Module --basedir base <repo>`
$MODMAN deploy Test_Module || echo "ERROR - Deploying"
test -e base/testlink || echo "ERROR - base/testlink does not exist"
test -L base/testlink || echo "ERROR - base/testlink is not a link"
[[ "$(readlink -f base/testlink)" = "$(readlink -f $modmandir/Test_Module/src/testfile)" ]] || echo "ERROR - link destination is incorrect"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment