From 142268c016bf2cdfe162194e753e78a5f4999e73 Mon Sep 17 00:00:00 2001 From: Maxwell Jeffress Date: Wed, 28 Jan 2026 18:58:39 +1100 Subject: [PATCH] Output ground files as executable --- src/main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 384768c..2631dca 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -56,8 +57,9 @@ int main(int argc, char** argv) { if (!outputFile) { std::cout << "Failed to write to " << args.output.value().value << "\n"; } - outputFile << result; + outputFile << "#!/usr/bin/env ground\n" << result; outputFile.close(); + system(std::string("chmod +x " + args.output.value().value).c_str()); exit(0); } else if (args.outputtype.value().value == "native") { std::string assembly(groundCompileProgram(&program));