piston/packages/gleam/0.27.0/compile
2023-03-13 00:24:15 -04:00

16 lines
480 B
Bash
Executable file

#!/usr/bin/env bash
gleam new project --skip-git > /dev/null
mkdir project/build
cp /piston/packages/gleam/0.27.0/project/manifest.toml project/manifest.toml
cp /piston/packages/gleam/0.27.0/project/build/packages* project/build -r 2> /dev/null
cat $1 > project/src/project.gleam
# Compile args need to be read by run
shift
echo "$@" > compile_args
cd project
# Awk is used to remove lines from the output that don't help for the piston output.
gleam build "$@" | awk "NR>=4"