From 0a44d8c873c3ce29778390ddfab1828fd233e591 Mon Sep 17 00:00:00 2001 From: Bryan Roe Date: Sat, 16 Jan 2021 14:33:06 -0800 Subject: [PATCH] Updated agent-update ARCHID detection on macOS to workaround bug in specific older versions --- agents/meshcore.js | 11 +++++++++-- agents/recoverycore.js | 9 ++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/agents/meshcore.js b/agents/meshcore.js index e14a268e..d811af12 100644 --- a/agents/meshcore.js +++ b/agents/meshcore.js @@ -53,8 +53,15 @@ if (require('MeshAgent').ARCHID == null) id = require('_GenericMarshal').PointerSize == 4 ? 31 : 30; break; case 'darwin': - id = require('os').arch() == 'x64' ? 16 : 29; - break; + try + { + id = require('os').arch() == 'x64' ? 16 : 29; + } + catch (xx) + { + id = 16; + } + break; break; } if (id != null) { Object.defineProperty(require('MeshAgent'), 'ARCHID', { value: id }); } } diff --git a/agents/recoverycore.js b/agents/recoverycore.js index 74a999d4..20e367be 100644 --- a/agents/recoverycore.js +++ b/agents/recoverycore.js @@ -18,7 +18,14 @@ if (require('MeshAgent').ARCHID == null) id = require('_GenericMarshal').PointerSize == 4 ? 31 : 30; break; case 'darwin': - id = require('os').arch() == 'x64' ? 16 : 29; + try + { + id = require('os').arch() == 'x64' ? 16 : 29; + } + catch(xx) + { + id = 16; + } break; } if (id != null) { Object.defineProperty(require('MeshAgent'), 'ARCHID', { value: id }); }