#!/bin/bash

set -e

echo Text:

if command -v pygmentize 2>&1 >/dev/null
then
    pygmentize -l rust -Ostyle="gruvbox-dark",linenos=1 $1
else
    cat $1
fi

echo Compiling $1...

deno run --allow-read --allow-write --check compiler/main.ts $1

echo Running out.slgbc...

./runtime/build/sliger run out.slgbc ${@:2}