#!/usr/bin/env php parse($file); $compiled = (new Compiler)->compile($program); // dd($compiled); $cwd = getcwd(); if (! is_dir(__DIR__ . '/../build')) { mkdir(__DIR__ . '/../build'); } chdir(__DIR__ . '/../build'); if (file_exists('./go.mod')) { unlink('./go.mod'); } shell_exec('go mod init my-script'); shell_exec('go get github.com/ryangjchandler/trunk'); shell_exec('go mod edit -replace github.com/ryangjchandler/trunk=../../trunk_go'); file_put_contents('./my-script.go', $compiled);