Skip to content
This repository was archived by the owner on Mar 27, 2025. It is now read-only.

Commit de5db98

Browse files
committed
Updated as per review comments
1 parent a5f8cf2 commit de5db98

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/resources/+ciplugins/+jenkins/BuildReportPlugin.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@
66

77
function runTaskGraph(plugin, pluginData)
88
[email protected](plugin, pluginData);
9-
[fID, msg] = fopen(fullfile(getenv("WORKSPACE"),'.matlab/buildArtifact.json'), 'w');
9+
[fID, msg] = fopen(fullfile(getenv("WORKSPACE"),".matlab/buildArtifact.json"), "w");
1010

1111
if fID == -1
12-
warning('BuildTool:artifactFileWarnning','Could not open a file for Jenkins build result table due to: %s', msg);
12+
warning('ciplugins:jenkins:BuildReportPlugin:UnableToOpenFile','Could not open a file for Jenkins build result table due to: %s', msg);
1313
else
14+
closeFile = onCleanup(@()fclose(fID));
1415
taskDetails = struct();
1516
for idx = 1:numel(pluginData.TaskResults)
1617
taskDetails(idx).name = pluginData.TaskResults(idx).Name;
@@ -22,7 +23,6 @@ function runTaskGraph(plugin, pluginData)
2223
a = struct("taskDetails",taskDetails);
2324
s = jsonencode(a,"PrettyPrint",true);
2425
fprintf(fID, '%s',s);
25-
fclose(fID);
2626
end
2727
end
2828
end

0 commit comments

Comments
 (0)