Package: Fix resource copy on Linux

This commit is contained in:
Jérôme Leclercq 2017-10-06 15:03:03 +02:00 committed by Lynix
parent 84537fcfb8
commit cb57721a65
1 changed files with 3 additions and 10 deletions

View File

@ -84,13 +84,13 @@ ACTION.Function = function ()
local libFileMasks
local exeFileExt
local exeFilterFunc
if (os.is("windows")) then
if (os.ishost("windows")) then
binFileMasks = {"**.dll", "**.pdb"}
libFileMasks = {"**.lib", "**.a"}
exeFileExt = ".exe"
exeFilterFunc = function (filePath) return true end
else
if (os.is("macosx")) then
if (os.ishost("macosx")) then
binFileMasks = {"**.dynlib"}
else
binFileMasks = {"**.so"}
@ -183,14 +183,7 @@ ACTION.Function = function ()
end
end
local ok, err
if (os.is("windows")) then
ok, err = os.copyfile(v, targetPath)
else
-- Workaround: As premake is translating this to "cp %s %s", it fails if space are presents in source/destination paths.
ok, err = os.copyfile(string.format("\"%s\"", v), string.format("\"%s\"", targetPath))
end
local ok, err = os.copyfile(v, targetPath)
if (not ok) then
print("Failed to copy \"" .. v .. "\" to \"" .. targetPath .. "\": " .. err)
end