Skip to content

Commit e684c89

Browse files
committed
workaround SF brokenness
1 parent c46dce5 commit e684c89

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

scen_edit/command/project/copy_custom_project_files_command.lua

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,15 @@ function CopyCustomProjectFilesCommand:execute()
2626
Spring.CreateDir(destDir)
2727

2828
local srcFileContent = VFS.LoadFile(srcPath, VFS.RAW)
29-
local destFile = assert(io.open(destPath, "w"))
30-
destFile:write(srcFileContent)
31-
destFile:close()
29+
30+
-- TODO: Do this in JS where this isn't a problem and no crappy workaround is necessary.
31+
xpcall(function()
32+
local destFile = assert(io.open(destPath, "w"))
33+
destFile:write(srcFileContent)
34+
destFile:close()
35+
end, function(err)
36+
Log.Error(debug.traceback(err, 3))
37+
Log.Error("Error copying project file " .. destPath .. " . Consider including it manually")
38+
end)
3239
end)
3340
end

0 commit comments

Comments
 (0)