2019-04-04 11:33:38 +03:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
# Copyright (c) 2019 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
|
|
set -eu
|
|
|
|
|
|
|
|
DAML_LF_REPL=$1
|
2019-04-15 15:47:59 +03:00
|
|
|
DAMLC=$2
|
2019-04-04 11:33:38 +03:00
|
|
|
MAIN=$3
|
|
|
|
TMPDIR=$(mktemp -d)
|
|
|
|
|
|
|
|
cleanup() {
|
|
|
|
rm -rf "$TMPDIR"
|
|
|
|
}
|
|
|
|
trap cleanup EXIT
|
|
|
|
|
|
|
|
case "${MAIN##*.}" in
|
|
|
|
dalf)
|
|
|
|
$DAML_LF_REPL testAll "$MAIN"
|
|
|
|
;;
|
|
|
|
daml)
|
2019-04-15 15:47:59 +03:00
|
|
|
$DAMLC export-lf-v1 "$MAIN" -o $TMPDIR/out.dalf
|
2019-04-04 11:33:38 +03:00
|
|
|
$DAML_LF_REPL testAll $TMPDIR/out.dalf
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "Unknown file extension on $MAIN" 1>&2
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|