Fork of daniellemaywood.uk/gleam — Wasm codegen work
905 B
49 lines
1# SPDX-License-Identifier: Apache-2.0
2# SPDX-FileCopyrightText: 2026 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
15fail() {
16 echo "$1" >&2
17 exit 1
18}
19
20file=src/symlink_escape.gleam
21target="../../hextarball/src/hextarball.gleam"
22
23echo "Checking that the src file is a symlink"
24
25if [ ! -L "$file" ]; then
26 fail "Expected $file to be a symlink"
27fi
28
29if [ ! -e "$file" ]; then
30 fail "Expected $file to resolve"
31fi
32
33actual=$(readlink "$file")
34if [ "$actual" != "$target" ]; then
35 fail "Expected $file to resolve to $target, got $actual"
36fi
37
38echo Resetting the build directory to get to a known state
39rm -fr build
40
41echo Running publish should not publish anything
42if yes "n" | g publish; then
43 echo "Expected publish to fail, but it succeeded"
44 exit 1
45fi
46
47echo
48echo Success! 💖
49echo