mirror of
https://github.com/Detanup01/gbe_fork.git
synced 2024-11-23 19:25:35 +08:00
fix dir flattening for linux
This commit is contained in:
parent
0133ffa52e
commit
bbe0fa934c
@ -363,10 +363,12 @@ for _, dep in pairs(deps_to_extract) do
|
|||||||
error('extraction failed')
|
error('extraction failed')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- flatten dir by moving all folders contents outside (one level above)
|
||||||
|
print('flattening dir: ' .. out_folder)
|
||||||
local folders = os.matchdirs(out_folder .. '/*')
|
local folders = os.matchdirs(out_folder .. '/*')
|
||||||
for _, vv in pairs(folders) do
|
for _, inner_folder in pairs(folders) do
|
||||||
local inner_folder = os.realpath(vv)
|
-- the weird "/*" at the end is not a mistake, premake uses cp cpmmand on linux, which won't copy inner dir otherwise
|
||||||
local ok = os.execute('{COPYDIR} "' .. inner_folder .. '" "' .. out_folder .. '"')
|
local ok = os.execute('{COPYDIR} "' .. inner_folder .. '"/* "' .. out_folder .. '"')
|
||||||
if not ok then
|
if not ok then
|
||||||
error('copy dir failed, src=' .. inner_folder .. ', dest=' .. out_folder)
|
error('copy dir failed, src=' .. inner_folder .. ', dest=' .. out_folder)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user