Skip to content

Commit

Permalink
Fix compilation when hxml is not provided
Browse files Browse the repository at this point in the history
  • Loading branch information
l0go committed Jul 2, 2024
1 parent 898bd37 commit c1344fd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Main.hx
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,16 @@ class Main {

// Create a temporary folder in memory for holding the source
final dir = new String(ChildProcess.spawnSync("mktemp", ["-d", "-p", sourceRepository]).stdout).trim();

sys.io.File.saveContent('$dir/Main.hx', src);
ChildProcess.exec('chmod 755 $dir/', null, null);
ChildProcess.exec('chmod 755 $dir/Main.hx', null, null);

final user = Sys.getEnv("HAXE_USER") ?? Sys.getEnv("USER");
final uid = Std.parseInt(ChildProcess.execSync('id -u $user'));

var process = ChildProcess.spawn("haxe", ["params.hxml"].concat(hxml.split(" ")).concat(["-cp", dir]), untyped {uid: uid, timeout: 3000, cwd: '/home/$user'});
final hxmlSplit = [for (c in hxml.split(" ")) if (c.trim() != "") c];
var process = ChildProcess.spawn("haxe", ["params.hxml"].concat(hxmlSplit).concat(["-cp", dir]), untyped {uid: uid, timeout: 3000, cwd: '/home/$user'});

var stdout = "";
process.stdout.on('data', (data) -> {
Expand Down

0 comments on commit c1344fd

Please sign in to comment.