From 2b04eebcabc87926266d33cc9d0e7ceafaca742a Mon Sep 17 00:00:00 2001 From: Bryan Roe Date: Mon, 24 Oct 2022 11:33:40 -0700 Subject: [PATCH 1/2] Synced changes for silent install, with agent repo --- agents/meshinstall-linux.js | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/agents/meshinstall-linux.js b/agents/meshinstall-linux.js index 403d374413..1f047afff0 100644 --- a/agents/meshinstall-linux.js +++ b/agents/meshinstall-linux.js @@ -222,21 +222,19 @@ if ((!skip) && ((msh.InstallFlags & 2) == 2)) if (!skip) { - if (process.platform != 'darwin') + if (process.argv.includes('-install') || process.argv.includes('-update')) { - if (process.argv.includes('-install') || process.argv.includes('-update')) + var p = []; + for (var i = 0; i < process.argv.length; ++i) { - var p = []; - for (var i = 0; i < process.argv.length; ++i) + if (process.argv[i].startsWith('--installPath=')) { - if (process.argv[i].startsWith('--installPath=')) - { - p.push('--installPath="' + process.argv[i].split('=').pop() + '"'); - } - else if(process.argv[i].startsWith('--')) - { - p.push(process.argv[i]); - } + p.push('--installPath="' + process.argv[i].split('=').pop() + '"'); + } + else if(process.argv[i].startsWith('--')) + { + p.push(process.argv[i]); + } } _install(p); process.exit(); @@ -274,12 +272,11 @@ if ((!skip) && ((msh.InstallFlags & 2) == 2)) process.exit(); } } + if (process.platform == 'darwin') + { + if (!require('user-sessions').isRoot()) { console.log('\n' + translation[lang].elevation); process.exit(); } + } } - else - { - if (!require('user-sessions').isRoot()) { console.log('\n' + translation[lang].elevation); process.exit(); } - } -} if (!skip) From d07ca171f9a0b1716f4126a6a66252c7131c99ce Mon Sep 17 00:00:00 2001 From: Bryan Roe Date: Mon, 24 Oct 2022 13:26:29 -0700 Subject: [PATCH 2/2] Fixed redirection --- agents/meshcore.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/agents/meshcore.js b/agents/meshcore.js index d2fca767a7..afebe45452 100644 --- a/agents/meshcore.js +++ b/agents/meshcore.js @@ -56,7 +56,8 @@ function __readdirSync_fix(path) var sysnative = false; pathstr = require('fs')._fixwinpath(path); if (pathstr.split('\\*').join('').toLowerCase() == process.env['windir'].toLowerCase()) { sysnative = true; } - var ret = __readdirSync_old(path); + + var ret = require('fs').__readdirSync_old(path); if (sysnative) { ret.push('sysnative'); } return (ret); }