Skip to content

Commit 90f88b9

Browse files
committed
build(fix): use raw JSON package file to extract version for older releases
1 parent 8c0fa8e commit 90f88b9

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/utility/+mag/version.m

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,15 @@
1313
location = fileparts(mfilename("fullpath"));
1414
root = fullfile(location, "../../../");
1515

16-
package = matlab.mpm.Package(root);
17-
ver = package.Version;
16+
if isMATLABReleaseOlderThan("R2025a")
17+
18+
package = readstruct(fullfile(root, "resources", "mpackage.json"));
19+
ver = package.version;
20+
else
21+
22+
package = matlab.mpm.Package(root);
23+
ver = package.Version;
24+
end
1825
end
1926

2027
v = ver;

0 commit comments

Comments
 (0)