add osx custom filename to zip
Signed-off-by: si458 <simonsmith5521@gmail.com>
si458 committed
Mar 4, 2024 at 11:17 UTC
473b9d0265568d58326c663e0b006e85e2a35b9d
1 file changed
+7
-1
webserver.js
+7
-1
@@ -5843,8 +5843,14 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF
5843
var archive = require('archiver')('zip', { level: 5 }); // Sets the compression method.
5844
archive.on('error', function (err) { throw err; });
5845
5846
+ // Customize the mesh agent file name
5847
+ var meshfilename = 'MeshAgent-' + mesh.name + '.zip'
5848
+ if ((domain.agentcustomization != null) && (typeof domain.agentcustomization.filename == 'string')) {
5849
+ meshfilename = meshfilename.split('meshagent').join(domain.agentcustomization.filename).split('MeshAgent').join(domain.agentcustomization.filename);
5850
+ }
5851
+
5852
// Set the agent download including the mesh name.
5847
- setContentDispositionHeader(res, 'application/octet-stream', 'MeshAgent-' + mesh.name + '.zip', null, 'MeshAgent.zip');
5853
+ setContentDispositionHeader(res, 'application/octet-stream', meshfilename, null, 'MeshAgent.zip');
5854
archive.pipe(res);
5855
5856
// Opens the "MeshAgentOSXPackager.zip"