From a89b7401cfd2328655f8a551d326ea2edab72335 Mon Sep 17 00:00:00 2001 From: Bryan Roe Date: Fri, 17 Jan 2020 15:08:22 -0800 Subject: [PATCH] Updated to check script version on linux, as older versions that 2.25 does not work correctly. --- agents/meshcore.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/agents/meshcore.js b/agents/meshcore.js index b099ee69..1a3b0762 100644 --- a/agents/meshcore.js +++ b/agents/meshcore.js @@ -1190,7 +1190,16 @@ function createMeshCore(agent) { try { var bash = fs.existsSync('/bin/bash') ? '/bin/bash' : false; var sh = fs.existsSync('/bin/sh') ? '/bin/sh' : false; - var script = fs.existsSync('/usr/bin/script') ? '/usr/bin/script' : false; + var script = false; + if (require('linux-gnome-helpers').scriptVersion) + { + if (require('linux-gnome-helpers').scriptVersion.major > 2 || + (require('linux-gnome-helpers').scriptVersion.major == 2 && require('linux-gnome-helpers').scriptVersion.minor >= 25)) + { + script = '/usr/bin/script'; + } + } + var python = fs.existsSync('/usr/bin/python') ? '/usr/bin/python' : false; var shell = bash || sh;