···11+#!/bin/sh
22+33+set -eu
44+55+GLEAM_COMMAND=${GLEAM_COMMAND:-"cargo run --quiet --"}
66+77+g() {
88+ echo "Running: $GLEAM_COMMAND $@"
99+ $GLEAM_COMMAND "$@"
1010+}
1111+1212+fail() {
1313+ echo "$1" >&2
1414+ exit 1
1515+}
1616+1717+file=priv/symlink.toml
1818+target="../../hextarball/gleam.toml"
1919+2020+echo "Checking that the src file is a symlink"
2121+2222+if [ ! -L "$file" ]; then
2323+ fail "Expected $file to be a symlink"
2424+fi
2525+2626+if [ ! -e "$file" ]; then
2727+ fail "Expected $file to resolve"
2828+fi
2929+3030+actual=$(readlink "$file")
3131+if [ "$actual" != "$target" ]; then
3232+ fail "Expected $file to resolve to $target, got $actual"
3333+fi
3434+3535+echo Resetting the build directory to get to a known state
3636+rm -fr build
3737+3838+echo Running publish should not publish anything
3939+if yes "n" | g publish; then
4040+ echo "Expected publish to fail, but it succeeded"
4141+ exit 1
4242+fi
4343+4444+echo
4545+echo Success! 💖
4646+echo
···11+#!/bin/sh
22+33+set -eu
44+55+GLEAM_COMMAND=${GLEAM_COMMAND:-"cargo run --quiet --"}
66+77+g() {
88+ echo "Running: $GLEAM_COMMAND $@"
99+ $GLEAM_COMMAND "$@"
1010+}
1111+1212+fail() {
1313+ echo "$1" >&2
1414+ exit 1
1515+}
1616+1717+file=src/symlink_escape.gleam
1818+target="../../hextarball/src/hextarball.gleam"
1919+2020+echo "Checking that the src file is a symlink"
2121+2222+if [ ! -L "$file" ]; then
2323+ fail "Expected $file to be a symlink"
2424+fi
2525+2626+if [ ! -e "$file" ]; then
2727+ fail "Expected $file to resolve"
2828+fi
2929+3030+actual=$(readlink "$file")
3131+if [ "$actual" != "$target" ]; then
3232+ fail "Expected $file to resolve to $target, got $actual"
3333+fi
3434+3535+echo Resetting the build directory to get to a known state
3636+rm -fr build
3737+3838+echo Running publish should not publish anything
3939+if yes "n" | g publish; then
4040+ echo "Expected publish to fail, but it succeeded"
4141+ exit 1
4242+fi
4343+4444+echo
4545+echo Success! 💖
4646+echo