-
I wrote a rule and I want to add some args to my run function for example. If I do |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
I don't know your mean, But you can check the |
Beta Was this translation helpful? Give feedback.
-
I want to create custom args in my on_run function |
Beta Was this translation helpful? Give feedback.
-
I think I didn't ask my question properly. I want to do something like this : on_run(function(target)
if not target:kind() == "binary" then
return
end
import("core.base.option")
import("core.project.config")
import("lib.detect.find_program")
if option.get("nx") ~= nil and option.get("nx") ~= "" then
if find_program("nxlink") then
nxlink = "nxlink"
else
nxlink = "nxlink"
cprint("You must add nxlink to your PATH variable")
end
local target_file = target:targetfile()
local executable = target_file .. ".nro"
local nxlink_args = {"-a", option.get("nx"), "-s", executable}
cprint("Launching from nxlink " .. executable)
vprint(nxlink, table.unpack(nxlink_args))
os.runv(nxlink, nxlink_args)
else
if find_tool("ryujinx", {program = "ryujinx"}) then
ryujinx = "ryujinx"
elseif find_tool("Ryujinx", {program = "Ryujinx"}) then
ryujinx = "Ryujinx"
else
cprint("You must add ryujinx to your PATH variable")
return
end
local target_file = target:targetfile()
local executable = target_file .. ".nro"
cprint("Launching " .. executable)
os.runv(ryujinx, {executable})
end
end) and when i do something like |
Beta Was this translation helpful? Give feedback.
see
xmake/xmake/actions/run/main.lua
Line 51 in af3090a