Skip to content

Commit 447fe76

Browse files
DenzellceWolf
authored andcommitted
fix: convert session data build_target to table if needed
PR #332 introduced handling for multiple targets. Yet, old session data still has the build_target stored as string resulting in an error when trying to unpack the string when forming the --target arg. This PR fixes this issue by converting old session data to the new format, if needed
1 parent 90e4f16 commit 447fe76

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lua/cmake-tools/session.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ function session.update(config, old_config)
7474
end
7575
if old_config.build_target then
7676
config.build_target = old_config.build_target
77+
if type(config.build_target) ~= "table" then -- Backwards compatibility (could be removed after a grace period) see PR!332
78+
config.build_target = { config.build_target }
79+
end
7780
end
7881
if old_config.launch_target then
7982
config.launch_target = old_config.launch_target

0 commit comments

Comments
 (0)