From 99a4f8b6ea15be22be68aec38bc50cf563e1f2ab Mon Sep 17 00:00:00 2001 From: TSnake41 Date: Sun, 29 Mar 2020 15:41:11 +0200 Subject: [PATCH] Add optional output argument for raylua builder. --- src/raylua_builder.lua | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/raylua_builder.lua b/src/raylua_builder.lua index 2f81a55..96d6dec 100644 --- a/src/raylua_builder.lua +++ b/src/raylua_builder.lua @@ -52,7 +52,7 @@ print ">> Raylua builder <<" if #arg == 0 then print "TODO: Improve builder usage." - print "Usage: raylua_e " + print "Usage: raylua_e [output]" return end @@ -69,17 +69,19 @@ end print("Self is " .. self_path) if t == "directory" then - local path = input_path + local output = arg[2] - if ffi.os == "Windows" then - path = path .. ".exe" - else - path = path .. ".elf" + if not output then + if ffi.os == "Windows" then + output = output .. ".exe" + else + output = output .. ".elf" + end end - print("Building " .. path) + print("Building " .. output) - local builder = builder_new(self_path, path) + local builder = builder_new(self_path, output) assert(builder, "Can't initialize builder") local have_main = false