babashka/script/lib_tests/comb_test
Michiel Borkent ce028644fc comb
2020-03-21 17:27:41 +01:00

21 lines
476 B
Bash
Executable file

#!/usr/bin/env bash
set -eo pipefail
export BABASHKA_CLASSPATH=$(clojure -Spath -Sdeps '{:deps {comb {:mvn/version "0.1.1"}}}')
if [ "$BABASHKA_TEST_ENV" = "native" ]; then
BB_CMD="./bb"
else
BB_CMD="lein bb"
fi
$BB_CMD '
(ns foo (:require [comb.template :as template]))
(prn (template/eval "<% (dotimes [x 3] %>foo<% ) %>"))
(prn (template/eval "Hello <%= name %>" {:name "Alice"}))
(def hello
(template/fn [name] "Hello <%= name %>"))
(prn (hello "Alice"))
'