Fork of daniellemaywood.uk/gleam — Wasm codegen work
876 B
37 lines
1# SPDX-License-Identifier: Apache-2.0
2# SPDX-FileCopyrightText: 2024 The Gleam contributors
3
4#!/bin/sh
5
6set -eu
7
8GLEAM_COMMAND=${GLEAM_COMMAND:-"cargo run --quiet --"}
9
10g() {
11 echo "Running: $GLEAM_COMMAND $@"
12 $GLEAM_COMMAND "$@"
13}
14
15echo Resetting the build directory to get to a known state
16rm -fr build
17
18echo This should succeed regardless of root package compilation errors as it is a dependency module
19g run --module=hello_joe
20g run --module=hello_joe --target=erlang
21g run --module=hello_joe --target=javascript
22
23echo Running for Erlang should fail, even if previously a Erlang dependency was built
24if g run --target=erlang; then
25 echo "Expected run to fail"
26 exit 1
27fi
28
29echo Running for JavaScript should fail, even if previously a JavaScript dependency was built
30if g run --target=javascript; then
31 echo "Expected run to fail"
32 exit 1
33fi
34
35echo
36echo Success! 💖
37echo