Skip to content

Commit

Permalink
translate path
Browse files Browse the repository at this point in the history
  • Loading branch information
waruqi committed Dec 21, 2023
1 parent 6417898 commit e7e4a16
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion xmake/plugins/pack/batchcmds.lua
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ end
-- on build target command
function _on_target_buildcmd(target, batchcmds_, opt)
local package = opt.package
batchcmds_:vrunv("xmake", {"build", target:name()})
batchcmds_:vrunv("xmake", {"build", "-y", target:name()})
end

-- on install target command
Expand Down
12 changes: 10 additions & 2 deletions xmake/plugins/pack/srpm/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,16 @@ function _get_customcmd(package, installcmds, cmd)
local dir = _translate_filepath(package, cmd.dir)
table.insert(installcmds, string.format("mkdir -p \"%s\"", dir))
elseif cmd.program then
-- TODO translate path
table.insert(installcmds, string.format("%s", os.args(table.join(cmd.program, cmd.argv))))
local argv = {}
for _, arg in ipairs(cmd.argv) do
if path.instance_of(arg) then
arg = arg:clone():set(_translate_filepath(package, arg:rawstr())):str()
elseif path.is_absolute(arg) then
arg = _translate_filepath(package, arg)
end
table.insert(argv, arg)
end
table.insert(installcmds, string.format("%s", os.args(table.join(cmd.program, argv))))
end
end

Expand Down

0 comments on commit e7e4a16

Please sign in to comment.